Method and device for detecting overlapping irregular non-closed objects

By using linear segment detection and closed suppression combination algorithms in image processing, the problem of overlapping irregular non-closed objects in the image is solved, and higher detection accuracy and efficiency are achieved, and the error rate of drawing review is reduced.

CN112991258BActive Publication Date: 2025-02-18GUANGDONG PLANNING & DESIGNING INST OF TELECOMM
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110047377.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-14
Publication Date
2025-02-18
Estimated Expiration
2041-01-14

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect and separate overlapping non-closed objects in images, resulting in low drawing review efficiency and high error rate.

Method used

A detection method is adopted, including obtaining image information, performing image opening operations to highlight the object to be detected, using a linear segment detection algorithm to detect the object to be detected, and reconstructing the object to be detected through a closed suppression combination algorithm.

Benefits of technology

It improves the accuracy and efficiency of detection of overlapping irregular non-enclosed objects, reduces manpower investment and error rate, and improves the efficiency of drawing review.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112991258B_ABST
    Figure CN112991258B_ABST
Patent Text Reader

Abstract

In the embodiment of the present invention, image information including an object to be detected is obtained, an image opening operation is performed on the image information to highlight the object to be detected, and the object highlighting image information is obtained; a straight line segment detection operation is performed on the object highlighting image information using a straight line segment detection algorithm to determine all straight line segment objects in the object highlighting image information; a closed suppression combination algorithm is used to perform a straight line segment reconstruction operation on all straight line segment objects to determine the object to be detected in the image information. It can be seen that the present invention can automatically perform image processing and object detection on image information to determine overlapping irregular non-closed objects in the image information. Compared with the algorithms in the prior art, the present invention has higher detection accuracy and detection efficiency for overlapping irregular non-closed objects, and can greatly reduce the investment of manpower and material resources, reduce the error rate, and improve the efficiency of drawing review.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a detection method and device for overlapping irregular non-closed objects. Background Art

[0002] Compliance review of engineering design drawings is a common requirement in the industry. For example, in the field of telecommunications design, it involves the review of the norms of graphics, tables, text, etc. in design drawings. The review of graphics involves whether the graphic objects meet the legend requirements and determining the relationship between objects. This part of the work was mainly done manually in the past, which was costly. Recently, the country has proposed the strategic construction of AI, and the development of manual review to intelligent review is bound to become a trend.

[0003] One of the key points of intelligent auditing is the detection of graphic objects. At present, it is relatively easy to detect some simple objects in the industry, such as circles and triangles, which are often composed of regular closed graphics and do not overlap. However, for irregular, non-closed, and overlapping objects, existing methods are difficult to detect accurately, and accurately separating each complete object from overlapping objects is difficult. However, the detection of such objects is related to many actual business needs, such as crossed lines in drawings, non-closed overlapping frames, etc. Therefore, solving this problem is of great significance. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a detection method and device for overlapping irregular non-closed objects, which can automatically perform image processing and object detection on image information to determine the overlapping irregular non-closed objects in the image information. Compared with the algorithms in the prior art, the present invention has higher detection accuracy and detection efficiency for overlapping irregular non-closed objects, and can greatly reduce the investment in manpower and material resources, reduce the error rate, and improve the efficiency of drawing review.

[0005] In order to solve the above technical problem, the first aspect of the present invention discloses a method for detecting overlapping irregular non-closed objects, the method comprising:

[0006] Acquire image information including an object to be detected, perform an image opening operation on the image information to highlight the object to be detected, and obtain object-highlighted image information; the object to be detected is an overlapping irregular non-closed object;

[0007] Performing a straight line segment detection operation on the object salient image information using a straight line segment detection algorithm to determine all straight line segment objects in the object salient image information;

[0008] A closed suppression combination algorithm is used to perform a straight line segment reconstruction operation on all the straight line segment objects to determine the object to be detected in the image information.

[0009] As an optional implementation, in the first aspect of the present invention, the acquiring includes image information of the object to be detected, performing an image opening operation on the image information to highlight the object to be detected, and obtaining the object highlighted image information includes:

[0010] Performing a binarization operation on the image information to obtain binarized image information;

[0011] An image opening operation is performed on the binary image information to highlight the object to be detected, thereby obtaining object-highlighted image information.

[0012] As an optional implementation, in the first aspect of the present invention, performing an image opening operation on the binary image information to highlight the object to be detected and obtain the object highlighting image information includes:

[0013] Performing an image corrosion operation on the binary image information to remove irrelevant background information, thereby obtaining corroded image information;

[0014] An image dilation operation is performed on the eroded image information to highlight the object to be detected, thereby obtaining object-highlighted image information.

[0015] As an optional implementation, in the first aspect of the present invention, the step of performing a straight line segment detection operation on the object salient image information using a straight line segment detection algorithm to determine all straight line segment objects in the object salient image information includes:

[0016] The object salient image information is processed using a Canny edge detection algorithm to obtain a refined edge image; the refined edge image includes edge information of all straight line segment objects in the object salient image information;

[0017] The refined edge image is processed using a Hough line detection algorithm to determine all straight line segment objects in the object protrusion image information.

[0018] As an optional implementation, in the first aspect of the present invention, the using of the Canny edge detection algorithm to process the object salient image information to obtain a refined edge image includes:

[0019] Performing smoothing filtering on the salient image information of the object to obtain smoothed filtered image information;

[0020] Performing gradient image calculation processing on the smoothed filtered image information to obtain a gradient image and a gradient direction image of the smoothed filtered image information;

[0021] Performing non-maximum suppression calculation based on the gradient image and gradient direction image of the image information after the smoothing filter to obtain an edge image;

[0022] The edge image is subjected to hysteresis threshold processing to obtain a refined edge image.

[0023] As an optional implementation, in the first aspect of the present invention, the method of processing the refined edge image using the Hough line detection algorithm to determine all straight line segment objects in the object protrusion image information includes:

[0024] Performing edge binarization processing on the refined edge image to obtain edge binary image information; the value of edge pixel points in the edge binary image information is 255;

[0025] For each edge pixel point in the edge binary image information, calculating a continuous curve corresponding to the edge pixel point in the parameter space;

[0026] Calculating the intersection points of the continuous curves corresponding to all the edge pixel points in the parameter space to obtain an intersection point set including a plurality of intersection points;

[0027] Calculating the number of intersections of each intersection point in the intersection point set, and determining whether the number of intersections is greater than a preset number threshold, if so, retaining the corresponding intersection point, if not, removing the corresponding intersection point from the intersection point set;

[0028] The intersection points in the intersection point set are converted into Cartesian coordinate straight line equations, and all straight line segment objects in the object protruding image information are obtained by drawing.

[0029] As an optional implementation, in the first aspect of the present invention, the using a closed suppression combination algorithm to perform a straight line segment reconstruction operation on all straight line segment objects to determine the object to be detected in the image information includes:

[0030] Calculate the adjacency matrix L of the endpoint distance of the straight line segment object; each element in the adjacency matrix L is specifically:

[0031]

[0032] Where L ij represents the minimum endpoint distance between the i-th straight line segment object and the j-th straight line segment object, and Represents the distance between the ath endpoint of the i-th straight line segment object and the bth endpoint of the j-th straight line segment object;

[0033] Filter the elements in the adjacency matrix L:

[0034] For all elements in the adjacency matrix L, if the element is greater than the first distance threshold, the element is set to a negative element, and all elements on the matrix diagonal in the adjacency matrix L are set to negative elements;

[0035] Traversing the elements of each row in the adjacency matrix L, when there are two or more non-negative elements greater than the second distance threshold in the elements of any row, the smallest and the second-to-last two elements of the two or more non-negative elements greater than the second distance threshold are kept unchanged, and the remaining elements in the row are set to negative elements;

[0036] Determine the combination set S of straight line segment objects:

[0037] For the two straight line segment objects corresponding to each non-negative element in the adjacency matrix L, they form a tuple. Then all the tuples constitute the straight line segment object combination set S, which is expressed as follows:

[0038] S={(i,j)|L ij ≥0};

[0039] According to the fact that the binary pairs (i, j) and (j, i) are the same binary pairs, the straight line segment object combination set S is deduplicated;

[0040] Grouping non-closed objects:

[0041] Select any two-tuple from the straight line object combination set S as a reference two-tuple, and compare the reference two-tuple with other two-tuples in the straight line object combination set S;

[0042] If the reference binary group and any other binary group have the same straight line segment object, the reference binary group and the binary group are determined as target binary groups, and the reference binary group is updated to the difference set between the reference binary group and the binary group;

[0043] Execute the above steps until it is determined that the reference binary group cannot find the same straight line segment object as other binary groups or there is no straight line segment object in the reference binary group;

[0044] If it is determined that the reference binary group cannot find the same straight line segment object as other binary groups, the straight line segment objects corresponding to all the determined target binary groups are output as the result, so as to output the object to be detected in the image information;

[0045] If it is determined that there is no straight line segment object in the reference binary group, all the straight line segment objects corresponding to the determined target binary groups are removed from the straight line segment object combination set S;

[0046] The above steps are repeated until the straight line segment object combination set S is empty.

[0047] A second aspect of the present invention discloses a detection device for overlapping irregular non-closed objects, the device comprising:

[0048] A highlight processing module, used for acquiring image information including an object to be detected, performing an image opening operation on the image information to highlight the object to be detected, and obtaining object highlight image information; the object to be detected is an overlapping irregular non-closed object;

[0049] A line segment detection module, configured to perform a straight line segment detection operation on the object salient image information using a straight line segment detection algorithm, and determine all straight line segment objects in the object salient image information;

[0050] The line segment reconstruction module is used to perform a line segment reconstruction operation on all the straight line segment objects using a closed suppression combination algorithm to determine the object to be detected in the image information.

[0051] As an optional implementation, in the second aspect of the present invention, the highlight processing module acquires image information including the object to be detected, performs an image opening operation on the image information to highlight the object to be detected, and obtains the specific method of the object highlighting image information, including:

[0052] Performing a binarization operation on the image information to obtain binarized image information;

[0053] An image opening operation is performed on the binary image information to highlight the object to be detected, thereby obtaining object-highlighted image information.

[0054] As an optional implementation, in the second aspect of the present invention, the highlight processing module performs an image opening operation on the binary image information to highlight the object to be detected, and obtains the specific manner of the object highlight image information, including:

[0055] Performing an image corrosion operation on the binary image information to remove irrelevant background information, thereby obtaining corroded image information;

[0056] An image dilation operation is performed on the eroded image information to highlight the object to be detected, thereby obtaining object-highlighted image information.

[0057] As an optional implementation, in the second aspect of the present invention, the line segment detection module uses a straight line segment detection algorithm to perform a straight line segment detection operation on the object salient image information to determine all straight line segment objects in the object salient image information, including:

[0058] The object salient image information is processed using a Canny edge detection algorithm to obtain a refined edge image; the refined edge image includes edge information of all straight line segment objects in the object salient image information;

[0059] The refined edge image is processed using a Hough line detection algorithm to determine all straight line segment objects in the object protrusion image information.

[0060] As an optional implementation, in the second aspect of the present invention, the line segment detection module uses the Canny edge detection algorithm to process the object salient image information to obtain a refined edge image, including:

[0061] Performing smoothing filtering on the salient image information of the object to obtain smoothed filtered image information;

[0062] Performing gradient image calculation processing on the smoothed filtered image information to obtain a gradient image and a gradient direction image of the smoothed filtered image information;

[0063] Performing non-maximum suppression calculation based on the gradient image and gradient direction image of the image information after the smoothing filter to obtain an edge image;

[0064] The edge image is subjected to hysteresis threshold processing to obtain a refined edge image.

[0065] As an optional implementation, in the second aspect of the present invention, the line segment detection module uses the Hough line detection algorithm to process the refined edge image to determine the specific manner of all straight line segment objects in the object protruding image information, including:

[0066] Performing edge binarization processing on the refined edge image to obtain edge binary image information; the value of edge pixel points in the edge binary image information is 255;

[0067] For each edge pixel point in the edge binary image information, calculating a continuous curve corresponding to the edge pixel point in the parameter space;

[0068] Calculating the intersection points of the continuous curves corresponding to all the edge pixel points in the parameter space to obtain an intersection point set including a plurality of intersection points;

[0069] Calculating the number of intersections of each intersection point in the intersection point set, and determining whether the number of intersections is greater than a preset number threshold, if so, retaining the corresponding intersection point, if not, removing the corresponding intersection point from the intersection point set;

[0070] The intersection points in the intersection point set are converted into Cartesian coordinate straight line equations, and all straight line segment objects in the object protruding image information are obtained by drawing.

[0071] As an optional implementation, in the second aspect of the present invention, the line segment reconstruction module uses a closed suppression combination algorithm to perform a straight line segment reconstruction operation on all straight line segment objects to determine a specific manner of the object to be detected in the image information, including:

[0072] Calculate the adjacency matrix L of the endpoint distance of the straight line segment object; each element in the adjacency matrix L is specifically:

[0073]

[0074] Where L ij represents the minimum endpoint distance between the i-th straight line segment object and the j-th straight line segment object, and l ij ab Represents the distance between the ath endpoint of the i-th straight line segment object and the bth endpoint of the j-th straight line segment object;

[0075] Filter the elements in the adjacency matrix L:

[0076] For all elements in the adjacency matrix L, if the element is greater than the first distance threshold, the element is set to a negative element, and all elements on the matrix diagonal in the adjacency matrix L are set to negative elements;

[0077] Traversing the elements of each row in the adjacency matrix L, when there are two or more non-negative elements greater than the second distance threshold in the elements of any row, the smallest and the second-to-last two elements of the two or more non-negative elements greater than the second distance threshold are kept unchanged, and the remaining elements in the row are set to negative elements;

[0078] Determine the combination set S of straight line segment objects:

[0079] For the two straight line segment objects corresponding to each non-negative element in the adjacency matrix L, they form a tuple. Then all the tuples constitute the straight line segment object combination set S, which is expressed as follows:

[0080] S={(i,j)|L ij ≥0};

[0081] According to the fact that the binary pairs (i, j) and (j, i) are the same binary pairs, the straight line segment object combination set S is deduplicated;

[0082] Grouping non-closed objects:

[0083] Select any two-tuple from the straight line object combination set S as a reference two-tuple, and compare the reference two-tuple with other two-tuples in the straight line object combination set S;

[0084] If the reference binary group and any other binary group have the same straight line segment object, the reference binary group and the binary group are determined as target binary groups, and the reference binary group is updated to the difference set between the reference binary group and the binary group;

[0085] Execute the above steps until it is determined that the reference binary group cannot find the same straight line segment object as other binary groups or there is no straight line segment object in the reference binary group;

[0086] If it is determined that the reference binary group cannot find the same straight line segment object as other binary groups, the straight line segment objects corresponding to all the determined target binary groups are output as the result, so as to output the object to be detected in the image information;

[0087] If it is determined that there is no straight line segment object in the reference binary group, all the straight line segment objects corresponding to the determined target binary groups are removed from the straight line segment object combination set S;

[0088] The above steps are repeated until the straight line segment object combination set S is empty.

[0089] A third aspect of the present invention discloses another detection device for overlapping irregular non-closed objects, the device comprising:

[0090] A memory storing executable program code;

[0091] a processor coupled to the memory;

[0092] The processor calls the executable program code stored in the memory to execute part or all of the steps in the method for detecting overlapping irregular non-closed objects disclosed in the first aspect of the embodiment of the present invention.

[0093] A fourth aspect of an embodiment of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute part or all of the steps in the method for detecting overlapping irregular non-closed objects disclosed in the first aspect of the embodiment of the present invention.

[0094] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0095] In the embodiment of the present invention, image information including an object to be detected is obtained, and an image opening operation is performed on the image information to highlight the object to be detected, so as to obtain object highlighting image information; the object to be detected is an overlapping irregular non-closed object; a straight line segment detection algorithm is used to perform a straight line segment detection operation on the object highlighting image information to determine all straight line segment objects in the object highlighting image information; a closed suppression combination algorithm is used to perform a straight line segment reconstruction operation on all straight line segment objects to determine the object to be detected in the image information. It can be seen that the present invention can automatically perform image processing and object detection on image information to determine overlapping irregular non-closed objects in the image information. Compared with the algorithms in the prior art, the present invention has higher detection accuracy and detection efficiency for overlapping irregular non-closed objects, and can greatly reduce the investment of manpower and material resources, reduce the error rate, and improve the efficiency of drawing review. BRIEF DESCRIPTION OF THE DRAWINGS

[0096] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0097] Figure 1 It is a flow chart of a detection method for overlapping irregular non-closed objects disclosed in an embodiment of the present invention;

[0098] Figure 2 It is a structural schematic diagram of a detection device for overlapping irregular non-closed objects disclosed in an embodiment of the present invention;

[0099] Figure 3 is a structural schematic diagram of another detection device for overlapping irregular non-closed objects disclosed in an embodiment of the present invention;

[0100] Figure 4 It is a data schematic diagram of an engineering drawing to be processed disclosed in an embodiment of the present invention;

[0101] Figure 5 It is a schematic diagram of the effect of the detection result of overlapping irregular non-closed objects disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0102] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0103] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.

[0104] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0105] The present invention discloses a detection method and device for overlapping irregular non-closed objects, which can automatically perform image processing and object detection on image information to determine overlapping irregular non-closed objects in the image information. Compared with the algorithms in the prior art, the present invention has higher detection accuracy and efficiency for overlapping irregular non-closed objects, and can greatly reduce the input of manpower and material resources, reduce the error rate, and improve the efficiency of drawing review. The following are detailed descriptions. Example 1

[0106] See also Figure 1 , Figure 1 1 is a flow chart of a detection method for overlapping irregular non-closed objects disclosed in an embodiment of the present invention. Before describing the embodiment of the present invention, the invention purpose corresponding to the embodiment of the present invention is described first. The purpose of the embodiment of the present invention is to extract overlapping irregular non-closed objects in a figure. Such objects are usually connected by a number of regular straight line segments in engineering drawings, such as Figure 4 As shown, the Figure 4 The bold black non-closed line in the upper right corner is the target to be detected. Figure 1 As shown, the detection method of overlapping irregular non-closed objects may include the following operations:

[0107] 101. Acquire image information including an object to be detected, perform an image opening operation on the image information to highlight the object to be detected, and obtain object-highlighted image information.

[0108] Specifically, the object to be detected is an overlapping irregular non-closed object;

[0109] 102. Use a straight line segment detection algorithm to perform a straight line segment detection operation on the object salient image information to determine all straight line segment objects in the object salient image information.

[0110] 103. Use the closed suppression combination algorithm to perform straight line segment reconstruction operations on all straight line segment objects to determine the objects to be detected in the image information.

[0111] It can be seen that by implementing the embodiments of the present invention, image information can be automatically processed and object detected to determine overlapping irregular non-closed objects in the image information. Compared with the algorithms in the prior art, the present invention has higher detection accuracy and efficiency for overlapping irregular non-closed objects, and can greatly reduce the investment in manpower and material resources, reduce the error rate, and improve the efficiency of drawing review.

[0112] As an optional implementation, in an embodiment of the present invention, in step 101, image information including an object to be detected is obtained, and an image opening operation is performed on the image information to highlight the object to be detected, so as to obtain object-highlighted image information, including:

[0113] Performing a binarization operation on the image information to obtain binarized image information;

[0114] An image opening operation is performed on the binary image information to highlight the object to be detected, thereby obtaining object-highlighted image information.

[0115] As an optional implementation, in an embodiment of the present invention, performing an image opening operation on the binary image information in the above step to highlight the object to be detected and obtain the object highlighting image information includes:

[0116] Performing an image erosion operation on the binary image information to remove irrelevant background information, thereby obtaining eroded image information;

[0117] An image dilation operation is performed on the eroded image information to highlight the object to be detected, thereby obtaining object-highlighted image information.

[0118] Specifically, the purpose of the above steps is to remove irrelevant objects from the original image. Since the overlapping irregular non-closed objects discussed in the present invention are usually composed of regular straight line segments, removing irrelevant objects (such as text, tables, regular graphics, etc.) in the original image will help with subsequent detection work. Here, the morphological erosion and expansion operations in traditional image processing are mainly used to complete the combination, wherein both the erosion and expansion operations use pre-designed structural elements to perform sliding processing on the binary image, specifically:

[0119] Erosion is to find the minimum pixel value in the structural element area and assign the minimum pixel value to the anchor pixel. For example, in a binary image, the target object is a bright area and the background is a dark area. By corroding the binary image, the outline of the target object in the image will shrink inward, thus reducing the size of the target object. Let the binary image be I and the structural element be W. e , then the corrosion result E is:

[0120] E=IΘW e ;

[0121] Dilation is to find the maximum pixel value in the structural element area and assign the maximum pixel value to the anchor pixel. For example, in a binary image, the target object is a bright area and the background is a dark area. By dilating the binary image, the outline of the target object in the image will expand outward, achieving the effect of magnifying the target object. Let the binary image be I and the structural element be W. d , then the corrosion result D is:

[0122] D=I⊕W d ;

[0123] Through the erosion operation, objects with thin contours in the original image can be removed, and through the expansion operation, the target object to be detected in the original image can be highlighted.

[0124] As an optional implementation, in the embodiment of the present invention, the use of a straight line segment detection algorithm in step 102 to perform a straight line segment detection operation on the object salient image information to determine all straight line segment objects in the object salient image information includes:

[0125] The object salient image information is processed using the Canny edge detection algorithm to obtain a refined edge image; the refined edge image includes edge information of all straight line segment objects in the object salient image information;

[0126] The refined edge image is processed using the Hough line detection algorithm to determine all straight line segment objects in the object protrusion image information.

[0127] The purpose of the above steps is that after the previous processing, only the graphic elements that constitute the object to be detected are retained in the image. Since irregular non-closed objects are usually composed of regular straight line segments, it is necessary to detect the straight line segment image elements therefrom for subsequent reconstruction of the irregular non-closed objects.

[0128] As an optional implementation, in the embodiment of the present invention, the above steps of using the Canny edge detection algorithm to process the object salient image information to obtain a refined edge image include:

[0129] Performing smoothing filtering on the prominent image information of the object to obtain smoothed filtered image information;

[0130] Performing gradient image calculation processing on the image information after smoothing filtering to obtain a gradient image and a gradient direction image of the image information after smoothing filtering;

[0131] Perform non-maximum suppression calculation based on the gradient image and gradient direction image of the image information after smoothing filtering to obtain an edge image;

[0132] The edge image is processed by hysteresis threshold to obtain a refined edge image.

[0133] Specifically, the Canny edge detection algorithm is used to process the prominent image information of the object to obtain a refined edge image, including:

[0134] Perform smoothing filtering on the original image f to obtain a smoothed image g (usually using Gaussian smoothing filtering);

[0135] Use the first-order differential gradient operator (Sobel operator, Prewitt operator, Roberts operator, etc.) to obtain the first-order differential gradient of the smoothed image g in each direction, and obtain the gradient images grad_x and grad_y in each direction;

[0136] Use the gradient images grad_x and grad_y in each direction to calculate the gradient image grad, and calculate the gradient direction image ang le;

[0137] Combine the gradient image grad and the gradient direction image ang le to perform non-maximum suppression and obtain the edge image NMS

[0138] The edge image NMS is processed with double threshold hysteresis threshold, and the points with edge gradient greater than the high threshold are determined as strong edges; the points with edge gradient less than the low threshold are suppressed; for the points less than the high threshold but greater than the low threshold, the edge connection path is searched towards the strong edge, and finally the extended edge is obtained;

[0139] Finally, a refined edge image edge is obtained.

[0140] As an optional implementation, in an embodiment of the present invention, the above step of using the Hough line detection algorithm to process the refined edge image to determine all straight line segment objects in the object protrusion image information includes:

[0141] The refined edge image is subjected to edge binarization processing to obtain edge binary image information; the value of edge pixel points in the edge binary image information is 255;

[0142] For each edge pixel in the edge binary image information, calculate the continuous curve corresponding to the edge pixel in the parameter space;

[0143] Calculate the intersection points of the continuous curves corresponding to all edge pixel points in the parameter space to obtain an intersection point set including multiple intersection points;

[0144] Calculate the number of intersections of each intersection point in the intersection point set, and determine whether the number of intersections is greater than a preset number threshold. If so, retain the corresponding intersection point; if not, remove the corresponding intersection point from the intersection point set;

[0145] The intersection points in the intersection point set are converted into Cartesian coordinate line equations, and all straight line segment objects in the object protrusion image information are drawn.

[0146] Specifically, in the Cartesian coordinate system, the straight line model can be expressed as:

[0147] y = k × x + b;

[0148] If the distance from the straight line to the origin is ρ, the foot of the perpendicular from the origin to the straight line is H, and the angle between the perpendicular OH and the x-axis is θ, then the above straight line model is converted to:

[0149]

[0150] After transformation, we get:

[0151] ρ = sinθ × y + cosθ × x;

[0152] It can be seen that there are countless straight lines passing through the point (x0, y0), where ρ (polar diameter) and θ (polar angle) are the parameters of the straight line. Different parameters (ρ, θ) represent different straight lines. Each straight line passing through the point (x0, y0) corresponds to a set of parameters (ρ, θ), so that each straight line can be mapped to the parameter space (ρ, θ). In this parameter space, the above equation can be drawn into a continuous curve. A point on this continuous curve represents a straight line passing through the point (x0, y0). Therefore, countless straight lines passing through the point (x0, y0) are mapped into this continuous curve. The method to detect whether multiple points are collinear is to map the set of straight lines passing through each point to the parameter space (ρ, θ) to obtain the corresponding continuous curve S. If the continuous curves corresponding to all points intersect at the same point, then these points are collinear, and the straight line corresponding to this intersection is the collinear straight line.

[0153] The distribution of edge pixels in an image is usually scattered, and not all edge points are necessarily distributed on the same straight line. However, if there is a straight edge in the image, there will be more edge pixels distributed on the straight line. Therefore, the straight line detection in the image is mainly to find a straight line with more collinear pixels among all edge pixels. According to the above method of judging collinearity, the following standard Hough line detection algorithm process is obtained:

[0154] The edge detection method is used to obtain the edge binary image of the image (the edge pixel value is 255).

[0155] For each edge pixel (x, y), a continuous curve S in the parameter space (ρ, θ) is calculated.

[0156] Calculate the set of intersection points of all continuous curves in the parameter space (ρ, θ) and count the number of intersections at each intersection point.

[0157] In the intersection point set, if the number of intersections of the intersection point is greater than the threshold, the intersection point is retained; otherwise, the intersection point is discarded.

[0158] Convert all retained intersection points back to the straight line equation in the Cartesian coordinate system and draw the straight line in the image.

[0159] The above steps process the image through the Canny edge detection algorithm to obtain the edge information of the graphic elements, and then use the Hough line detection algorithm to obtain all the straight line segments, which can achieve excellent straight line segment detection effect.

[0160] Specifically, in step 103, the irregular non-closed object needs to be reconstructed. Specifically, the straight line segments obtained by the above processing are reasonably combined to obtain a complete irregular non-closed object. Although the overlapping irregular non-closed objects targeted by this patent overlap with each other, they usually meet the following conditions:

[0161] (1) The intersection between objects does not occur at the endpoints of a straight line segment.

[0162] (2) In the same object, the intersection between straight line segments occurs only at the endpoints.

[0163] (3) The object is a non-closed figure.

[0164] It can be seen that a straight line segment can only be connected to two straight line segments at most. According to the distance relationship between the endpoints of the straight line segments, the closed suppression combination algorithm is used to find all complete irregular non-closed objects, and the separation results of all irregular non-closed objects in the engineering drawings are obtained.

[0165] As an optional implementation, in the embodiment of the present invention, the use of the closed suppression combination algorithm in step 103 to perform a straight line segment reconstruction operation on all straight line segment objects to determine the object to be detected in the image information includes:

[0166] Calculate the adjacency matrix L of the endpoint distance of the straight line segment object; each element in the adjacency matrix L is:

[0167]

[0168] Where L ij represents the minimum endpoint distance between the i-th straight line segment object and the j-th straight line segment object, and Represents the distance between the ath endpoint of the i-th straight line segment object and the bth endpoint of the j-th straight line segment object;

[0169] Filter elements in the adjacency matrix L:

[0170] For all elements in the adjacency matrix L, if the element is greater than the first distance threshold, the element is set to a negative element, and all elements on the matrix diagonal in the adjacency matrix L are set to negative elements;

[0171] Traverse the elements of each row in the adjacency matrix L. When there are two or more non-negative elements greater than the second distance threshold in the elements of any row, the smallest and second-to-last two elements of the two or more non-negative elements greater than the second distance threshold are kept unchanged, and the remaining elements in the row are set to negative elements;

[0172] Determine the combination set S of straight line segment objects:

[0173] For each non-negative element in the adjacency matrix L, the two straight line segment objects corresponding to the two tuples constitute a straight line segment object combination set S, which is expressed as:

[0174] S={(i,j)|L ij ≥0};

[0175] Since the tuples (i, j) and (j, i) are the same tuples, the combination set S of the straight line segment objects is deduplicated;

[0176] Grouping non-closed objects:

[0177] Select any two-tuple from the line segment object combination set S as a reference two-tuple, and compare the reference two-tuple with other two-tuples in the line segment object combination set S;

[0178] If there is a common straight line segment object between the reference binary group and any other binary group, the reference binary group and the binary group are determined as target binary groups, and the reference binary group is updated as the difference set between the reference binary group and the binary group;

[0179] The above steps are performed until it is determined that the reference binary group cannot find the same straight line segment object with other binary groups or there is no straight line segment object in the reference binary group;

[0180] If it is determined that the reference binary group cannot find the same straight line segment object as other binary groups, the straight line segment objects corresponding to all the determined target binary groups are output as the result to output the object to be detected in the image information;

[0181] If it is determined that there is no straight line segment object in the reference binary group, then all the straight line segment objects corresponding to the determined target binary groups are removed from the straight line segment object combination set S;

[0182] Repeat the above steps until the line segment object combination set S is empty.

[0183] Specifically, in the above steps, the purpose of setting all the elements on the matrix diagonal in the adjacency matrix L to negative elements is that the elements on the matrix diagonal in the adjacency matrix L are all the distances between the straight line segment objects themselves, that is, they must be 0, and the line segments themselves do not need to be combined. The value of 0 affects subsequent processing, so all the elements on the diagonal are set to negative elements, such as -1.

[0184] Specifically in the above steps, the benchmark binary is updated to the difference between the benchmark binary and the binary. For example, if the benchmark binary is (i, j) and the binary is (k, j), and there is an intersection j between the two, then the difference between the two (i, k) is used as the new benchmark binary.

[0185] In the above steps, if it is determined that the benchmark binary group cannot find the same straight line segment object between other binary groups, the benchmark binary group cannot be updated. This indicates that a non-closed object has been detected. All the straight line segments in all the binary groups previously used to update the benchmark are concatenated to obtain this non-closed object.

[0186] Specifically in the above steps, if it is determined that there is no straight line segment object in the reference binary group, it proves that the reference binary group is exactly the same as the binary group used for comparison, and the difference set between the two is empty, so the reference binary group is updated to empty, and there is no straight line segment object in it, which means that a closed object has been detected, just like the straight line segment object has gone around a circle and returned to the starting point. Therefore, the straight line segment objects corresponding to all the determined target binary groups are removed from the straight line segment object combination set S.

[0187] In order to better explain the detection method of the present invention to those skilled in the art, a method for extracting irregular non-closed overlapping objects in engineering drawings based on graphic features is taken as an example. The present invention intends to solve the problem of accurately separating each complete object from complex drawings with many interference items and irregular non-closed graphics as the target to be detected. The method includes the following steps:

[0188] 1. Input engineering drawing image I, such as Figure 4 As shown, a binarization process is performed to obtain a binary image B.

[0189] 2. By specifying the structural element W e and W d , perform corrosion and expansion processing on the binary image B to obtain the processed image B ed .

[0190] 3. Use Canny edge detection method to detect image B ed Processing is performed to obtain the edge information of the graphics.

[0191] 4. Use the Hough line detection method to detect vertical line segments and horizontal line segments respectively.

[0192] 5. Use the closed suppression combination algorithm to determine all complete irregular non-closed objects, and return the separation results of each irregular non-closed object in the case of overlapping objects in the engineering drawing. Figure 5 shown.

[0193] Embodiment 2

[0194] See also Figure 2 , Figure 2 Schematic diagram of a detection device for overlapping irregular non-enclosed objects disclosed in an embodiment of the present invention. Figure 2 As shown, the device may include:

[0195] The highlight processing module 101 is used to obtain image information including the object to be detected, perform an image opening operation on the image information to highlight the object to be detected, and obtain object highlighted image information.

[0196] Specifically, the object to be detected is an overlapping irregular non-closed object;

[0197] The line segment detection module 102 is used to perform a straight line segment detection operation on the object salient image information using a straight line segment detection algorithm to determine all straight line segment objects in the object salient image information.

[0198] The line segment reconstruction module 103 is used to perform a line segment reconstruction operation on all line segment objects using a closed suppression combination algorithm to determine the object to be detected in the image information.

[0199] It can be seen that by implementing the embodiments of the present invention, image information can be automatically processed and object detected to determine overlapping irregular non-closed objects in the image information. Compared with the algorithms in the prior art, the present invention has higher detection accuracy and efficiency for overlapping irregular non-closed objects, and can greatly reduce the investment in manpower and material resources, reduce the error rate, and improve the efficiency of drawing review.

[0200] As an optional implementation, in the embodiment of the present invention, the highlight processing module 101 obtains image information including the object to be detected, performs an image opening operation on the image information to highlight the object to be detected, and obtains the specific method of the object highlighting image information, including:

[0201] Performing a binarization operation on the image information to obtain binarized image information;

[0202] An image opening operation is performed on the binary image information to highlight the object to be detected, thereby obtaining object-highlighted image information.

[0203] As an optional implementation, in the embodiment of the present invention, the highlight processing module 101 performs an image opening operation on the binary image information to highlight the object to be detected, and obtains the specific method of the object highlight image information, including:

[0204] Performing an image erosion operation on the binary image information to remove irrelevant background information, thereby obtaining eroded image information;

[0205] An image dilation operation is performed on the eroded image information to highlight the object to be detected, thereby obtaining object-highlighted image information.

[0206] Specifically, the purpose of the above steps is to remove irrelevant objects from the original image. Since the overlapping irregular non-closed objects discussed in the present invention are usually composed of regular straight line segments, removing irrelevant objects (such as text, tables, regular graphics, etc.) in the original image will help with subsequent detection work. Here, the morphological erosion and expansion operations in traditional image processing are mainly used to complete the combination, wherein both the erosion and expansion operations use pre-designed structural elements to perform sliding processing on the binary image, specifically:

[0207] Erosion is to find the minimum pixel value in the structural element area and assign the minimum pixel value to the anchor pixel. For example, in a binary image, the target object is a bright area and the background is a dark area. By corroding the binary image, the outline of the target object in the image will shrink inward, thus reducing the size of the target object. Let the binary image be I and the structural element be W. e , then the corrosion result E is:

[0208] E=IΘW e ;

[0209] Dilation is to find the maximum pixel value in the structural element area and assign the maximum pixel value to the anchor pixel. For example, in a binary image, the target object is a bright area and the background is a dark area. By dilating the binary image, the outline of the target object in the image will expand outward, achieving the effect of magnifying the target object. Let the binary image be I and the structural element be W. d , then the corrosion result D is:

[0210] D=I⊕W d ;

[0211] Through the erosion operation, objects with thin contours in the original image can be removed, and through the expansion operation, the target object to be detected in the original image can be highlighted.

[0212] As an optional implementation, in the embodiment of the present invention, the line segment detection module 102 uses a straight line segment detection algorithm to perform a straight line segment detection operation on the object salient image information, and determines a specific method of all straight line segment objects in the object salient image information, including:

[0213] The object salient image information is processed using the Canny edge detection algorithm to obtain a refined edge image; the refined edge image includes edge information of all straight line segment objects in the object salient image information;

[0214] The refined edge image is processed using the Hough line detection algorithm to determine all straight line segment objects in the object protrusion image information.

[0215] The purpose of the above steps is that after the previous processing, only the graphic elements that constitute the object to be detected are retained in the image. Since irregular non-closed objects are usually composed of regular straight line segments, it is necessary to detect the straight line segment image elements therefrom for subsequent reconstruction of the irregular non-closed objects.

[0216] As an optional implementation, in the embodiment of the present invention, the line segment detection module 102 uses the Canny edge detection algorithm to process the object protrusion image information to obtain a refined edge image in a specific manner including:

[0217] Performing smoothing filtering on the prominent image information of the object to obtain smoothed filtered image information;

[0218] Performing gradient image calculation processing on the image information after smoothing filtering to obtain a gradient image and a gradient direction image of the image information after smoothing filtering;

[0219] Perform non-maximum suppression calculation based on the gradient image and gradient direction image of the image information after smoothing filtering to obtain an edge image;

[0220] The edge image is processed by hysteresis threshold to obtain a refined edge image.

[0221] Specifically, the line segment detection module 102 uses the Canny edge detection algorithm to process the object protrusion image information to obtain a refined edge image, including:

[0222] Perform smoothing filtering on the original image f to obtain a smoothed image g (usually using Gaussian smoothing filtering);

[0223] Use the first-order differential gradient operator (Sobel operator, Prewitt operator, Roberts operator, etc.) to obtain the first-order differential gradient of the smoothed image g in each direction, and obtain the gradient images grad_x and grad_y in each direction;

[0224] Use the gradient images grad_x and grad_y in each direction to calculate the gradient image grad, and calculate the gradient direction image ang le;

[0225] Combine the gradient image grad and the gradient direction image ang le to perform non-maximum suppression and obtain the edge image NMS

[0226] The edge image NMS is processed with double threshold hysteresis threshold, and the points with edge gradient greater than the high threshold are determined as strong edges; the points with edge gradient less than the low threshold are suppressed; for the points less than the high threshold but greater than the low threshold, the edge connection path is searched towards the strong edge, and finally the extended edge is obtained;

[0227] Finally, a refined edge image edge is obtained.

[0228] As an optional implementation, in the embodiment of the present invention, the line segment detection module 102 uses the Hough line detection algorithm to process the refined edge image, and the specific method of determining all straight line segment objects in the object protrusion image information includes:

[0229] The refined edge image is subjected to edge binarization processing to obtain edge binary image information; the value of edge pixel points in the edge binary image information is 255;

[0230] For each edge pixel in the edge binary image information, calculate the continuous curve corresponding to the edge pixel in the parameter space;

[0231] Calculate the intersection points of the continuous curves corresponding to all edge pixel points in the parameter space to obtain an intersection point set including multiple intersection points;

[0232] Calculate the number of intersections of each intersection point in the intersection point set, and determine whether the number of intersections is greater than a preset number threshold. If so, retain the corresponding intersection point; if not, remove the corresponding intersection point from the intersection point set;

[0233] The intersection points in the intersection point set are converted into Cartesian coordinate line equations, and all straight line segment objects in the object protrusion image information are drawn.

[0234] Specifically, in the Cartesian coordinate system, the straight line model can be expressed as:

[0235] y = k × x + b;

[0236] If the distance from the straight line to the origin is ρ, the foot of the perpendicular from the origin to the straight line is H, and the angle between the perpendicular OH and the x-axis is θ, then the above straight line model is converted to:

[0237]

[0238] After transformation, we get:

[0239] ρ = sinθ × y + cosθ × x;

[0240] It can be seen that there are countless straight lines passing through the point (x0, y0), where ρ (polar diameter) and θ (polar angle) are the parameters of the straight line. Different parameters (ρ, θ) represent different straight lines. Each straight line passing through the point (x0, y0) corresponds to a set of parameters (ρ, θ), so that each straight line can be mapped to the parameter space (ρ, θ). In this parameter space, the above equation can be drawn into a continuous curve. A point on this continuous curve represents a straight line passing through the point (x0, y0). Therefore, countless straight lines passing through the point (x0, y0) are mapped into this continuous curve. The method to detect whether multiple points are collinear is to map the set of straight lines passing through each point to the parameter space (ρ, θ) to obtain the corresponding continuous curve S. If the continuous curves corresponding to all points intersect at the same point, then these points are collinear, and the straight line corresponding to this intersection is the collinear straight line.

[0241] The distribution of edge pixels in an image is usually scattered, and not all edge points are necessarily distributed on the same straight line. However, if there is a straight edge in the image, there will be more edge pixels distributed on the straight line. Therefore, the straight line detection in the image is mainly to find a straight line with more collinear pixels among all edge pixels. According to the above method of judging collinearity, the following standard Hough line detection algorithm process is obtained:

[0242] The edge detection method is used to obtain the edge binary image of the image (the edge pixel value is 255).

[0243] For each edge pixel (x, y), a continuous curve S in the parameter space (ρ, θ) is calculated.

[0244] Calculate the set of intersection points of all continuous curves in the parameter space (ρ, θ) and count the number of intersections at each intersection point.

[0245] In the intersection point set, if the number of intersections of the intersection point is greater than the threshold, the intersection point is retained; otherwise, the intersection point is discarded.

[0246] Convert all retained intersection points back to the straight line equation in the Cartesian coordinate system and draw the straight line in the image.

[0247] The line segment detection module 102 processes the image by using the Canny edge detection algorithm to obtain edge information of graphic elements, and then uses the Hough line detection algorithm to obtain all straight line segments, thereby achieving an excellent straight line segment detection effect.

[0248] Specifically, the line segment reconstruction module 103 needs to reconstruct the irregular non-closed object. Specifically, the straight line segments obtained by the above processing are reasonably combined to obtain a complete irregular non-closed object. Although the overlapping irregular non-closed objects targeted by this patent overlap with each other, they usually meet the following conditions:

[0249] (4) The intersection between objects will not appear at the endpoints of a straight line segment.

[0250] (5) In the same object, the intersection between straight line segments occurs only at the endpoints.

[0251] (6) The object is a non-closed figure.

[0252] It can be seen that a straight line segment can only be connected to two straight line segments at most. According to the distance relationship between the endpoints of the straight line segments, the closed suppression combination algorithm is used to find all complete irregular non-closed objects, and the separation results of all irregular non-closed objects in the engineering drawings are obtained.

[0253] As an optional implementation, in the embodiment of the present invention, the line segment reconstruction module 103 uses the closed suppression combination algorithm to perform a straight line segment reconstruction operation on all straight line segment objects to determine the specific manner of the object to be detected in the image information, including:

[0254] Calculate the adjacency matrix L of the endpoint distance of the straight line segment object; each element in the adjacency matrix L is:

[0255]

[0256] Where L ij represents the minimum endpoint distance between the i-th straight line segment object and the j-th straight line segment object, and Represents the distance between the ath endpoint of the i-th straight line segment object and the bth endpoint of the j-th straight line segment object;

[0257] Filter elements in the adjacency matrix L:

[0258] For all elements in the adjacency matrix L, if the element is greater than the first distance threshold, the element is set to a negative element, and all elements on the matrix diagonal in the adjacency matrix L are set to negative elements;

[0259] Traverse the elements of each row in the adjacency matrix L. When there are two or more non-negative elements greater than the second distance threshold in the elements of any row, the smallest and second-to-last two elements of the two or more non-negative elements greater than the second distance threshold are kept unchanged, and the remaining elements in the row are set to negative elements;

[0260] Determine the combination set S of straight line segment objects:

[0261] For each non-negative element in the adjacency matrix L, the two straight line segment objects corresponding to the two tuples constitute a straight line segment object combination set S, which is expressed as:

[0262] S={(i,j)|L ij ≥0};

[0263] Since the tuples (i, j) and (j, i) are the same tuples, the combination set S of the straight line segment objects is deduplicated;

[0264] Grouping non-closed objects:

[0265] Select any two-tuple from the line segment object combination set S as a reference two-tuple, and compare the reference two-tuple with other two-tuples in the line segment object combination set S;

[0266] If there is a common straight line segment object between the reference binary group and any other binary group, the reference binary group and the binary group are determined as target binary groups, and the reference binary group is updated as the difference set between the reference binary group and the binary group;

[0267] The above steps are performed until it is determined that the reference binary group cannot find the same straight line segment object with other binary groups or there is no straight line segment object in the reference binary group;

[0268] If it is determined that the reference binary group cannot find the same straight line segment object as other binary groups, the straight line segment objects corresponding to all the determined target binary groups are output as the result to output the object to be detected in the image information;

[0269] If it is determined that there is no straight line segment object in the reference binary group, then all the straight line segment objects corresponding to the determined target binary groups are removed from the straight line segment object combination set S;

[0270] Repeat the above steps until the line segment object combination set S is empty.

[0271] Specifically, in the above steps, the purpose of setting all the elements on the matrix diagonal in the adjacency matrix L to negative elements is that the elements on the matrix diagonal in the adjacency matrix L are all the distances between the straight line segment objects themselves, that is, they must be 0, and the line segments themselves do not need to be combined. The value of 0 affects subsequent processing, so all the elements on the diagonal are set to negative elements, such as -1.

[0272] Specifically in the above steps, the benchmark binary is updated to the difference between the benchmark binary and the binary. For example, if the benchmark binary is (i, j) and the binary is (k, j), and there is an intersection j between the two, then the difference between the two (i, k) is used as the new benchmark binary.

[0273] In the above steps, if it is determined that the benchmark binary group cannot find the same straight line segment object between other binary groups, the benchmark binary group cannot be updated. This indicates that a non-closed object has been detected. All the straight line segments in all the binary groups previously used to update the benchmark are concatenated to obtain this non-closed object.

[0274] Specifically in the above steps, if it is determined that there is no straight line segment object in the reference binary group, it proves that the reference binary group is exactly the same as the binary group used for comparison, and the difference set between the two is empty, so the reference binary group is updated to empty, and there is no straight line segment object in it, which means that a closed object has been detected, just like the straight line segment object has gone around a circle and returned to the starting point. Therefore, the straight line segment objects corresponding to all the determined target binary groups are removed from the straight line segment object combination set S.

[0275] Embodiment 3

[0276] See also Figure 3 , Figure 3 FIG. 1 is a schematic diagram of the structure of another detection device for overlapping irregular non-closed objects disclosed in an embodiment of the present invention. Figure 3 As shown, the device may include:

[0277] A memory 301 storing executable program codes;

[0278] a processor 302 coupled to the memory 301;

[0279] The processor 302 calls the executable program code stored in the memory 301 to execute part or all of the steps in the detection method for overlapping irregular non-closed objects disclosed in the first embodiment of the present invention.

[0280] Embodiment 4

[0281] An embodiment of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute part or all of the steps in the detection method for overlapping irregular non-closed objects disclosed in the first embodiment of the present invention.

[0282] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0283] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0284] Finally, it should be noted that the detection method and device for overlapping irregular non-closed objects disclosed in the embodiment of the present invention only discloses the preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for detecting overlapping irregular non-closed objects, characterized in that: The method comprises: Acquire image information including an object to be detected, perform an image opening operation on the image information to highlight the object to be detected, and obtain object-highlighted image information; the object to be detected is an overlapping irregular non-closed object; Performing a straight line segment detection operation on the object salient image information using a straight line segment detection algorithm to determine all straight line segment objects in the object salient image information; Performing a straight line segment reconstruction operation on all the straight line segment objects using a closed suppression combination algorithm to determine the object to be detected in the image information; The step of performing a straight line segment detection operation on the object salient image information using a straight line segment detection algorithm to determine all straight line segment objects in the object salient image information includes: The object salient image information is processed using a Canny edge detection algorithm to obtain a refined edge image; the refined edge image includes edge information of all straight line segment objects in the object salient image information; Processing the refined edge image using a Hough line detection algorithm to determine all straight line segment objects in the object protrusion image information; The method of using the Canny edge detection algorithm to process the salient image information of the object to obtain a refined edge image includes: Performing smoothing filtering on the salient image information of the object to obtain smoothed filtered image information; Performing gradient image calculation processing on the smoothed filtered image information to obtain a gradient image and a gradient direction image of the smoothed filtered image information; Performing non-maximum suppression calculation based on the gradient image and gradient direction image of the image information after the smoothing filter to obtain an edge image; Performing hysteresis threshold processing on the edge image to obtain a refined edge image; The step of performing hysteresis threshold processing on the edge image to obtain a refined edge image includes: Performing double-threshold hysteresis threshold processing on the edge image, determining points with edge gradients greater than a high threshold as strong edges; suppressing points with edge gradients less than a low threshold; searching for edge connection paths toward strong edges for points less than a high threshold but greater than a low threshold, and finally obtaining extended edges; Finally, a refined edge image is obtained; And, performing a straight line segment reconstruction operation on all the straight line segment objects using a closed suppression combination algorithm to determine the object to be detected in the image information includes: Calculate the adjacency matrix L of the endpoint distance of the straight line segment object; each element in the adjacency matrix L is specifically: Where L ij represents the minimum endpoint distance between the i-th straight line segment object and the j-th straight line segment object, and Represents the distance between the ath endpoint of the i-th straight line segment object and the bth endpoint of the j-th straight line segment object; Filter the elements in the adjacency matrix L: For all elements in the adjacency matrix L, if the element is greater than the first distance threshold, the element is set to a negative element, and all elements on the matrix diagonal in the adjacency matrix L are set to negative elements; Traversing the elements of each row in the adjacency matrix L, when there are two or more non-negative elements greater than the second distance threshold in the elements of any row, the smallest and second-to-last two elements of the two or more non-negative elements greater than the second distance threshold are kept unchanged, and the remaining elements in the row are set to negative elements; Determine the combination set S of straight line segment objects: For the two straight line segment objects corresponding to each non-negative element in the adjacency matrix L, they form a tuple. Then all the tuples constitute the straight line segment object combination set S, which is expressed as follows: S={(i,j)|L ij ≥0}; According to the fact that the binary pairs (i, j) and (j, i) are the same binary pairs, the straight line segment object combination set S is deduplicated; Grouping non-closed objects: Select any two-tuple from the straight line object combination set S as a reference two-tuple, and compare the reference two-tuple with other two-tuples in the straight line object combination set S; If the reference binary group and any other binary group have the same straight line segment object, the reference binary group and the binary group are determined as target binary groups, and the reference binary group is updated to the difference set between the reference binary group and the binary group; Execute the above steps until it is determined that the reference binary group cannot find the same straight line segment object as other binary groups or there is no straight line segment object in the reference binary group; If it is determined that the reference binary group cannot find the same straight line segment object as other binary groups, the straight line segment objects corresponding to all the determined target binary groups are output as the result, so as to output the object to be detected in the image information; If it is determined that there is no straight line segment object in the reference binary group, all the straight line segment objects corresponding to the determined target binary groups are removed from the straight line segment object combination set S; The above steps are repeated until the straight line segment object combination set S is empty.

2. The method for detecting overlapping irregular non-closed objects according to claim 1, characterized in that: The acquiring includes image information of the object to be detected, performing an image opening operation on the image information to highlight the object to be detected, and obtaining object-highlighted image information, including: Performing a binarization operation on the image information to obtain binarized image information; An image opening operation is performed on the binary image information to highlight the object to be detected, thereby obtaining object-highlighted image information.

3. The method for detecting overlapping irregular non-closed objects according to claim 2, characterized in that: The performing an image opening operation on the binary image information to highlight the object to be detected and obtain object highlighted image information includes: Performing an image corrosion operation on the binary image information to remove irrelevant background information, thereby obtaining corroded image information; An image dilation operation is performed on the eroded image information to highlight the object to be detected, thereby obtaining object-highlighted image information.

4. The method for detecting overlapping irregular non-closed objects according to claim 1, characterized in that: The method of using the Hough line detection algorithm to process the refined edge image to determine all straight line segment objects in the object protrusion image information includes: Performing edge binarization processing on the refined edge image to obtain edge binary image information; the value of edge pixel points in the edge binary image information is 255; For each edge pixel point in the edge binary image information, calculating a continuous curve corresponding to the edge pixel point in the parameter space; Calculating the intersection points of the continuous curves corresponding to all the edge pixel points in the parameter space to obtain an intersection point set including a plurality of intersection points; Calculating the number of intersections of each intersection point in the intersection point set, and determining whether the number of intersections is greater than a preset number threshold, if so, retaining the corresponding intersection point, if not, removing the corresponding intersection point from the intersection point set; The intersection points in the intersection point set are converted into Cartesian coordinate straight line equations, and all straight line segment objects in the object protruding image information are obtained by drawing.

5. A detection device for overlapping irregular non-closed objects, characterized in that: The device comprises: A highlight processing module, used for acquiring image information including an object to be detected, performing an image opening operation on the image information to highlight the object to be detected, and obtaining object highlight image information; the object to be detected is an overlapping irregular non-closed object; A line segment detection module, configured to perform a straight line segment detection operation on the object salient image information using a straight line segment detection algorithm, and determine all straight line segment objects in the object salient image information; A line segment reconstruction module, used to perform a line segment reconstruction operation on all the line segment objects using a closed suppression combination algorithm to determine the object to be detected in the image information; The specific method in which the line segment detection module uses a straight line segment detection algorithm to perform a straight line segment detection operation on the object salient image information and determines all straight line segment objects in the object salient image information includes: Using the Canny edge detection algorithm to process the object salient image information to obtain a refined edge image; the refined edge image includes edge information of all straight line segment objects in the object salient image information; Processing the refined edge image using a Hough line detection algorithm to determine all straight line segment objects in the object protrusion image information; The specific method of the line segment detection module using the Canny edge detection algorithm to process the object protruding image information to obtain a refined edge image includes: Performing smoothing filtering on the salient image information of the object to obtain smoothed filtered image information; Performing gradient image calculation processing on the smoothed filtered image information to obtain a gradient image and a gradient direction image of the smoothed filtered image information; Performing non-maximum suppression calculation based on the gradient image and the gradient direction image of the image information after the smoothing filter to obtain an edge image; Performing hysteresis threshold processing on the edge image to obtain a refined edge image; The specific method of the line segment detection module performing hysteresis threshold processing on the edge image to obtain a refined edge image includes: Performing double-threshold hysteresis threshold processing on the edge image, determining points with edge gradients greater than a high threshold as strong edges; suppressing points with edge gradients less than a low threshold; searching for edge connection paths toward strong edges for points less than a high threshold but greater than a low threshold, and finally obtaining extended edges; Finally, a refined edge image is obtained; And, the line segment reconstruction module uses a closed suppression combination algorithm to perform a straight line segment reconstruction operation on all straight line segment objects to determine the specific manner of the object to be detected in the image information, including: Calculate the adjacency matrix L of the endpoint distance of the straight line segment object; each element in the adjacency matrix L is specifically: Where L ij represents the minimum endpoint distance between the i-th straight line segment object and the j-th straight line segment object, and Represents the distance between the ath endpoint of the i-th straight line segment object and the bth endpoint of the j-th straight line segment object; Filter the elements in the adjacency matrix L: For all elements in the adjacency matrix L, if the element is greater than the first distance threshold, the element is set to a negative element, and all elements on the matrix diagonal in the adjacency matrix L are set to negative elements; Traversing the elements of each row in the adjacency matrix L, when there are two or more non-negative elements greater than the second distance threshold in the elements of any row, the smallest and second-to-last two elements of the two or more non-negative elements greater than the second distance threshold are kept unchanged, and the remaining elements in the row are set to negative elements; Determine the combination set S of straight line segment objects: For the two straight line segment objects corresponding to each non-negative element in the adjacency matrix L, they form a tuple. Then all the tuples constitute the straight line segment object combination set S, which is expressed as follows: S={(i,j)|L ij ≥0}; According to the fact that the binary pairs (i, j) and (j, i) are the same binary pairs, the straight line segment object combination set S is deduplicated; Grouping non-closed objects: Select any two-tuple from the straight line object combination set S as a reference two-tuple, and compare the reference two-tuple with other two-tuples in the straight line object combination set S; If the reference binary group and any other binary group have the same straight line segment object, the reference binary group and the binary group are determined as target binary groups, and the reference binary group is updated to the difference set between the reference binary group and the binary group; Execute the above steps until it is determined that the reference binary group cannot find the same straight line segment object as other binary groups or there is no straight line segment object in the reference binary group; If it is determined that the reference binary group cannot find the same straight line segment object as other binary groups, the straight line segment objects corresponding to all the determined target binary groups are output as the result, so as to output the object to be detected in the image information; If it is determined that there is no straight line segment object in the reference binary group, all the straight line segment objects corresponding to the determined target binary groups are removed from the straight line segment object combination set S; The above steps are repeated until the straight line segment object combination set S is empty.

6. A detection device for overlapping irregular non-closed objects, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the method for detecting overlapping irregular non-closed objects according to any one of claims 1 to 4.

7. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the method for detecting overlapping irregular non-closed objects according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Intersection zebra crossing detection method based on fast Hough transform

    CN107066985A