CN113658111B - Crack detection method, system, device and medium for building or structure - Google Patents
Crack detection method, system, device and medium for building or structure Download PDFInfo
- Publication number
- CN113658111B CN113658111B CN202110850175.1A CN202110850175A CN113658111B CN 113658111 B CN113658111 B CN 113658111B CN 202110850175 A CN202110850175 A CN 202110850175A CN 113658111 B CN113658111 B CN 113658111B
- Authority
- CN
- China
- Prior art keywords
- image
- connected domain
- preset
- screening
- crack
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 65
- 238000012216 screening Methods 0.000 claims abstract description 64
- 238000000034 method Methods 0.000 claims abstract description 23
- 238000012545 processing Methods 0.000 claims description 37
- 238000001914 filtration Methods 0.000 claims description 8
- 238000007781 pre-processing Methods 0.000 claims description 5
- 239000011159 matrix material Substances 0.000 claims description 4
- 230000011218 segmentation Effects 0.000 claims description 4
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 27
- 230000000694 effects Effects 0.000 description 9
- 230000004927 fusion Effects 0.000 description 7
- 230000009286 beneficial effect Effects 0.000 description 4
- 238000000605 extraction Methods 0.000 description 4
- 238000012549 training Methods 0.000 description 4
- 238000004422 calculation algorithm Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000013135 deep learning Methods 0.000 description 2
- 238000003384 imaging method Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000005192 partition Methods 0.000 description 2
- 238000013139 quantization Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000011514 reflex Effects 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 208000024891 symptom Diseases 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/0008—Industrial image inspection checking presence/absence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
- G06T5/30—Erosion or dilatation, e.g. thinning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30132—Masonry; Concrete
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Image Processing (AREA)
Abstract
The application discloses a crack detection method, a system, a device and a medium for a building or a structure, wherein the method comprises the following steps: converting the preprocessed first image into a binary image, and screening out a second image meeting preset requirements from the binary image by adopting a preset rectangular window; screening the connected domain of the second image to obtain a third image; dividing the third image into fourth images of preset equal parts, and filling a full black background in the middle of every two adjacent equal parts of the fourth image to obtain a fifth image; carrying out connected domain screening and expansion treatment on the fifth image to obtain a seventh image; screening the connected domain of the seventh image, removing the filled full black background, and reducing the size of the seventh image to a preset size to obtain an eighth image; and determining whether a crack exists in the image to be detected according to the height-width ratio of the connected domain in the eighth image, and if so, marking the position of the crack in the image to be detected. The application does not need to rely on the image acquired by high-precision equipment.
Description
Technical Field
The application relates to an image processing technology, in particular to a crack detection method, a crack detection system, a crack detection device and a crack detection medium for a building or a structure.
Background
In the related art, crack detection in concrete buildings/structures mainly depends on manual naked eye observation, and the method has low efficiency and low accuracy. If the crack can be found in time at the initial stage of the crack occurrence and the development condition of the crack is tracked in real time, the maintenance cost can be greatly reduced, and the safety of the building/structure can be ensured. With the perfection of the machine vision detection technology, the existing machine vision-based crack/crack detection mainly has two main categories: one is to use deep learning, which mainly includes the steps of: firstly, training a marked crack/crack image through a convolutional neural network, and then detecting the crack/crack by using a trained model; the other is to use a more traditional image understanding method, firstly, preprocess the image, and then design a corresponding algorithm for detection according to the characteristics of cracks and the requirements of application scenes. Based on a crack detection mode of deep learning, a large number of training samples need to be processed in advance to obtain a detection model with higher precision; based on the crack detection mode of image understanding, image acquisition equipment with higher precision is required for image acquisition, and the uneven concrete surface can also influence the detection effect.
Disclosure of Invention
The present application aims to solve at least one of the technical problems existing in the prior art. Therefore, the application provides a crack detection method, a crack detection system, a crack detection device and a crack detection medium for a building or a structure, which can effectively detect cracks on the surface of concrete without training samples or high-precision acquisition equipment.
In a first aspect, an embodiment of the present application provides a crack detection method for a building or structure, including the steps of:
preprocessing the acquired image to be detected to obtain a first image, wherein the image to be detected comprises an original image of the building or the structure;
converting the first image into a binary image, and screening out a part of the connected domain meeting preset requirements from the binary image by adopting a preset rectangular window as a second image;
screening the connected domain of the second image to obtain a third image;
dividing the third image into a fourth image of preset equal parts, and filling a full black background in the middle of every two adjacent equal parts of the fourth image to obtain a fifth image;
screening the connected domain of the fifth image to obtain a sixth image;
performing expansion processing on the sixth image to obtain a seventh image;
screening the connected domain of the seventh image, removing the filled full black background, and reducing the size of the seventh image to a preset size to obtain an eighth image;
and determining whether a crack exists in the image to be detected according to the height-width ratio of the connected domain in the eighth image, and if so, marking the position of the crack in the image to be detected.
The crack detection method for the building or the structure provided by the embodiment of the application has the following beneficial effects:
according to the embodiment, the obtained image to be detected is preprocessed, the preprocessed image is converted into a binary image, the binary image is subjected to connected domain screening, then equal parts of the image subjected to connected domain screening are divided, the middle of the adjacent equal parts is filled with a full black background, then the connected domain screening is continued again, expansion processing is carried out again, finally the connected domain screening is carried out again, the image is restored to the image with the preset size after the full black background filled in the front is removed, whether a crack exists in the image to be detected is determined according to the ratio of the height to the width of the connected domain in the restored image, and the position of the crack is marked in the image to be detected after the crack exists is determined. The whole process of the embodiment can effectively detect the concrete surface cracks without depending on images acquired by high-precision acquisition equipment or making a large number of training images in the earlier stage.
In some embodiments, the preprocessing the acquired image to be detected to obtain a first image includes:
converting the image to be detected into a gray level image;
and scaling the gray level image to a preset size to obtain a first image.
In some embodiments, the converting the first image into a binary image, and screening, using a preset rectangular window, a portion of the binary image, where the connected domain meets a preset requirement, as the second image includes:
binarizing the pixel value on the right side of the first image to obtain a first binarized image;
screening out a part of the connected domain meeting the preset requirement from the first binarized image by adopting a preset rectangular window as a first connected domain image;
binarizing the left pixel value of the first image to obtain a second binarized image;
screening out a part of the connected domain meeting the preset requirement from the second binarized image by adopting a preset rectangular window as a second connected domain image;
performing logic union operation on the first connected domain image and the second connected domain image to obtain a third binarized image;
and screening out the part of the connected domain meeting the preset requirement from the third binarized image by adopting a preset rectangular window as a second image.
In some embodiments, the filtering the connected domain of the second image to obtain a third image includes:
removing isolated points with the size of the connected domain being a first preset value on the second image to obtain a purified binary image;
determining that two different first communicating domains and second communicating domains exist in the purified binary image, and acquiring the maximum ordinate of the first communicating domain and the minimum ordinate of the second communicating domain;
determining that the difference value between the maximum ordinate and the minimum ordinate is equal to one pixel, and fusing the first connected domain and the second connected domain to obtain a fused image;
and removing the connected domain with the number of pixels smaller than a second preset value in the range of the four connected domains in the fusion image to obtain a third image.
In some embodiments, the filtering the connected domain of the fifth image to obtain a sixth image includes:
and removing the connected domain with the height of the external matrix smaller than a third preset value in the range of the eight connected domains in the fifth image to obtain a sixth image.
In some embodiments, the expanding the sixth image to obtain a seventh image includes:
and performing expansion processing on the sixth image according to the preset structural elements to obtain a seventh image.
In some embodiments, the performing connected domain screening on the seventh image includes:
and removing the connected domain with the width of the transverse pixel of the connected domain smaller than a fourth preset value or larger than a fifth preset value in the seventh image, wherein the fourth preset value is smaller than the fifth preset value.
In a second aspect, embodiments of the present application provide a crack detection system for a building or structure, comprising:
the pretreatment module is used for carrying out pretreatment on the acquired image to be detected to obtain a first image, wherein the image to be detected comprises an original image of the building or the structure;
the conversion module is used for converting the first image into a binary image, and screening out a part of the connected domain meeting the preset requirement from the binary image by adopting a preset rectangular window as a second image;
the first screening module is used for screening the connected domain of the second image to obtain a third image;
the segmentation module is used for segmenting the third image into a fourth image of preset equal parts, and filling a full black background in the middle of every two adjacent equal parts of the fourth image to obtain a fifth image;
the second screening module is used for screening the connected domain of the fifth image to obtain a sixth image;
the expansion processing module is used for carrying out expansion processing on the sixth image to obtain a seventh image;
the first screening module is used for screening the connected domain of the seventh image, removing the filled full black background, and reducing the size of the seventh image to a preset size to obtain an eighth image;
and the judging module is used for determining whether a crack exists in the image to be detected according to the height-width ratio of the connected domain in the eighth image, and if so, marking the position of the crack in the image to be detected.
In a third aspect, embodiments of the present application provide a crack detection device for a building or structure, comprising:
at least one memory for storing a program;
at least one processor for loading the program to perform the crack detection method for a building or structure as shown in the embodiment of the first aspect.
In a fourth aspect, embodiments of the present application provide a storage medium in which a computer-executable program is stored, which when executed by a processor is configured to implement the crack detection method for a building or structure as shown in the embodiment of the first aspect.
Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application.
Drawings
The application is further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a schematic diagram of a crack structure according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a crack structure according to an embodiment of the present application;
FIG. 3 is a flow chart of a crack detection method for a building or structure according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a preprocessed first image according to an embodiment of the present application;
FIG. 5 is a diagram of a binary image after right side processing according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an image obtained by performing connected domain screening on the binary image shown in FIG. 5 according to an embodiment of the present application;
FIG. 7 is a diagram of a binary image after left-side processing according to an embodiment of the present application;
FIG. 8 is a schematic diagram of an image obtained after the connected domain screening of the binary image shown in FIG. 7 according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a binary image obtained by performing logical union of FIG. 6 and FIG. 7 according to an embodiment of the present application;
fig. 10 is a schematic diagram of an image obtained after the connected domain screening of the binary image shown in fig. 9 according to an embodiment of the present application;
FIG. 11 is a schematic diagram of an image of FIG. 10 after outlier removal according to an embodiment of the present application;
FIG. 12 is a schematic diagram of an image before connected domain fusion according to an embodiment of the present application;
FIG. 13 is a schematic image of the connected domain fusion according to the embodiment of the present application;
FIG. 14 is a schematic view of the image of FIG. 11 fused in accordance with an embodiment of the present application;
FIG. 15 is a schematic diagram of an image of FIG. 14 after connected domain screening according to an embodiment of the present application;
FIG. 16 is a schematic view of an image of the image of FIG. 15 after segmentation in accordance with an embodiment of the present application;
FIG. 17 is a schematic diagram of an image of a fifth image after connected domain screening according to an embodiment of the present application;
FIG. 18 is a schematic diagram of the calculation of the height threshold 25 according to an embodiment of the present application;
FIG. 19 is a schematic view of an image of FIG. 17 after the image is inflated according to an embodiment of the present application;
FIG. 20 is a schematic diagram of an image of FIG. 19 after connected domain screening according to an embodiment of the present application;
FIG. 21 is a schematic view of an image of FIG. 20 after processing according to an embodiment of the present application;
FIG. 22 is a schematic view of a crack portion image determined to remain in accordance with an embodiment of the present application;
FIG. 23 is a schematic image of a marked crack according to an embodiment of the present application;
FIG. 24 (a) is a schematic view of an original image according to an embodiment of the present application;
fig. 24 (b) is a schematic diagram of a detection result for the original image schematic diagram of fig. 24 (a) according to an embodiment of the present application;
FIG. 25 (a) is a schematic view of another original image according to an embodiment of the present application;
fig. 25 (b) is a schematic diagram of a detection result for the original image schematic diagram of fig. 25 (a) according to an embodiment of the present application;
FIG. 26 (a) is a schematic diagram of another original image according to an embodiment of the present application;
fig. 26 (b) is a schematic diagram of a detection result for the original image schematic diagram of fig. 26 (a) according to an embodiment of the present application;
FIG. 27 (a) is a schematic view of another original image according to an embodiment of the present application;
fig. 27 (b) is a schematic diagram of a detection result for the original image schematic diagram of fig. 27 (a) according to an embodiment of the present application;
FIG. 28 (a) is a schematic view of another original image according to an embodiment of the present application;
fig. 28 (b) is a schematic diagram of a detection result for the original image schematic diagram of fig. 28 (a) according to an embodiment of the present application;
FIG. 29 (a) is a schematic view of another original image according to an embodiment of the present application;
fig. 29 (b) is a schematic diagram of a detection result for the original image of fig. 29 (a) according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the application.
In the description of the present application, it should be understood that references to orientation descriptions such as upper, lower, front, rear, left, right, etc. are based on the orientation or positional relationship shown in the drawings, are merely for convenience of description of the present application and to simplify the description, and do not indicate or imply that the apparatus or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus should not be construed as limiting the present application.
In the description of the present application, the meaning of a number is one or more, the meaning of a number is two or more, and greater than, less than, exceeding, etc. are understood to exclude the present number, and the meaning of a number is understood to include the present number. The description of the first and second is for the purpose of distinguishing between technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present application, unless explicitly defined otherwise, terms such as arrangement, installation, connection, etc. should be construed broadly and the specific meaning of the terms in the present application can be reasonably determined by a person skilled in the art in combination with the specific contents of the technical scheme.
In the description of the present application, the descriptions of the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Cracks or fissures often appear on the surface of a concrete building or structure. Generally, the length of the crack is between 0 and 5mm, and the width is about 0 to 0.5 mm; whereas the slit has a length of more than 5mm and a width of more than 0.5mm. Both the crack and the crack are caused by stress, and the crack shown in fig. 1 is a pre-symptom of the crack shown in fig. 2, and the crack shown in fig. 2 is developed without any measures during the period of fig. 1. Due to the structural characteristics of concrete buildings, cracks or fissures are mostly distributed longitudinally or obliquely. Transverse cracks rarely occur and their presence does not affect structural load bearing, and therefore this embodiment is described based on longitudinal cracks.
In this example, the crack on the surface of the concrete building was detected by applying the image understanding technique to the range of the length and width of the crack.
Specifically, as shown in fig. 3, the embodiment of the application provides a crack detection method for a building or a structure, and the method can be applied to a background processor of each crack detection platform. The embodiment comprises the following steps:
s31, preprocessing the acquired image to be detected to obtain a first image. Wherein the image to be detected comprises an original image of a building or structure.
In the embodiment of the application, the first image is obtained by converting the image to be detected into the gray image and then scaling the gray image to a preset size. For example, if the image to be detected is a color image, the color image is converted into a grayscale image, and then the grayscale image is scaled to an image of 281 pixels in height and 251 pixels in width, thereby obtaining a preprocessed image as shown in fig. 4 as the first image. Specifically, the original image acquired by different imaging apparatuses and different settings also differ in size, and if processing is directly performed on the original image, not only is time-consuming but also it is difficult to unify the quantization criteria for judgment. According to the embodiment, the original image is fixed at a smaller size which does not affect the crack detection effect and is beneficial to the processing speed at the beginning of processing, so that unified quantization standards are conveniently used in the detection process, and the detection speed and the detection precision are improved at the same time.
In the present embodiment, the scaled size of the original image is defined as high 281 pixels and wide 251 pixels, which has the following effects:
the first point is that after the fixed picture size is determined, the subsequent steps of self-defining window screening, image expansion, unified setting of thresholds such as connected domain screening and the like are facilitated;
according to a related experiment, the size of the image to be processed is within 300 pixels×300 pixels, so that cracks can be effectively detected, and the detection speed is higher;
third, according to the present embodiment, the requirements of the connected domain screening and the processing effect of the moving window are customized, so that the image size is finally selected to be 281 pixels high and 251 pixels wide for processing the whole image without any left-over part.
S32, converting the first image into a binary image, and screening out the part of the connected domain meeting the preset requirement from the binary image by adopting a preset rectangular window as a second image.
In the embodiment of the application, the steps can be realized specifically by the following modes:
and performing binarization processing on the pixel value on the right side of the first image to obtain a first binarized image. Specifically, let f (i, j) denote the pixel gray value of the ith row and jth column, let f (i, j+1) denote the pixel gray value of the f (i, j) right side, then there are:
in this step F L A binary image as shown in fig. 5 is represented, which has a size identical to f as a first binary image, wherein a point in the first image where the gray value of all the left pixels is higher than 5 or more than the gray value of the right pixels is set to 1, otherwise, 0.
And screening out the part of the connected domain meeting the preset requirement from the first binarized image by adopting a preset rectangular window as a first connected domain image. Specifically, a preset rectangular window with a width of 31 pixels, a height of 81 pixels, a transverse step length 20 and a longitudinal step length 50 is used for screening out a part with the number of connected domains of the preset rectangular window being greater than or equal to 3 in the binary image in fig. 5, and the rest part is set to 0 to obtain a first connected domain image shown in fig. 6.
And performing binarization processing on the left pixel value of the first image to obtain a second binarized image. Specifically, let f (i, j) denote the pixel gray value of the ith row and jth column, let f (i, j-1) denote the pixel gray value of the f (i, j) left side, then there are:
in this step F R Representing a binary image as shown in FIG. 7, the binary image being a second binary image of a size consistent with f, wherein all right pixels in the first image have a gray level greater than or equal to 5 above the gray level of the left pixelsSet to 1, otherwise 0.
And screening out the part of the connected domain meeting the preset requirement from the second binarized image by adopting a preset rectangular window as a second connected domain image. Specifically, a preset rectangular window with a width of 31 pixels, a height of 81 pixels, a transverse step length 20 and a longitudinal step length 50 is used, in the binary image in fig. 7, a part with the number of connected domains of the preset rectangular window being greater than or equal to 3 is screened out, and the rest part is set to 0, so that a second connected domain image shown in fig. 8 is obtained.
And performing logical union operation on the first connected domain image shown in fig. 6 and the second connected domain image shown in fig. 8 to obtain a binary image shown in fig. 9 as a third binarized image.
And screening out the part of the connected domain meeting the preset requirement from the third binarized image by adopting a preset rectangular window as a second image. Specifically, a preset rectangular window with a width of 31 pixels, a height of 81 pixels, a transverse step length 20 and a longitudinal step length 50 is used, in the binary image in fig. 9, a part with the number of connected domains of the preset rectangular window being greater than or equal to 3 is screened out, and after the rest part is set to 0, the connected domain image shown in fig. 10 is obtained as a second image.
Specifically, unlike a crack, even if the crack is observed by naked eyes, the gray value at the crack after imaging has a small difference from the background gray value, and the gray value is a weak difference of gray level from the viewpoint of image processing, so that it is difficult to distinguish the crack from the background by directly extracting one or more characteristics of the crack. According to the embodiment, the crack is gradually separated from the surrounding background by the processing of left difference, right difference, union collection and connected domain fusion, so that the crack part in the image is highlighted, and the subsequent crack extraction is facilitated.
S33, screening the connected domain of the second image to obtain a third image.
In the embodiment of the application, the method can be realized by the following steps:
and removing isolated points with the connected domain size of the first preset value on the second image to obtain a purified binary image. For example, isolated points with a connected domain size of 1 are removed from the image shown in fig. 10, thereby obtaining a clean binary image as shown in fig. 11. In this process, the first preset value is set to 1.
Determining that two different first communicating domains and second communicating domains exist in the purified binary image, and acquiring the maximum ordinate of the first communicating domain and the minimum ordinate of the second communicating domain; and determining that the difference value between the maximum ordinate and the minimum ordinate is equal to one pixel, and fusing the first connected domain and the second connected domain to obtain a fused image. Specifically, it is first determined whether two different connected domains exist in the image shown in fig. 11, and if so, the maximum ordinate of one connected domain and the minimum ordinate of the other connected domain are obtained respectively, and when the maximum ordinate and the minimum ordinate differ by one pixel, the two connected domains are fused into one connected domain. As in the image before connected domain fusion shown in fig. 12, the image after connected domain fusion shown in fig. 13. In this step, all the adjacent images which are shown in fig. 11 and accord with the difference between the maximum ordinate and the minimum ordinate are fused to obtain a fused image shown in fig. 14.
And removing the connected domains with the number of the pixel points smaller than a second preset value in the range of the four connected domains in the fusion image to obtain a third image. For example, the connected domain having the number of pixels smaller than 8 in the range of four connected domains in the image shown in fig. 14 is removed, and the image shown in fig. 15 is obtained. The second preset value is set to 8.
S34, dividing the third image into fourth images of preset equal parts, and filling a full black background in the middle of every two adjacent equal parts of the fourth image to obtain a fifth image. For example, after the image shown in fig. 15 is equally divided into 11 parts in the horizontal direction or in the width direction, the image shown in fig. 16 is obtained, and then each part is individually processed in the image shown in fig. 16, and a full black background having a width of 10 pixels is filled in between each two parts.
Specifically, the cracks on the surface of the concrete have the characteristics that the whole trend is longitudinal and is distributed obliquely, the whole crack is locally broken due to different stress, and the like. According to the characteristics, after the image to be processed is transversely segmented, cracks are distributed among different cells in a segment form, extraction of the whole crack in the whole image is converted into extraction of the crack segment in the image partition, and detection difficulty is reduced and detection accuracy is improved.
And S35, screening the connected domain of the fifth image to obtain a sixth image. Specifically, removing connected domains with the height of the external matrix smaller than a third preset value in the range of the eight connected domains in the fifth image to obtain a sixth image. For example, in each divided region, connected regions having a circumscribed rectangle height of less than 25 in the eight connected regions are deleted, resulting in the image shown in fig. 17. In this step, the third preset value is set to 25. Wherein the height threshold 25 is calculated by the method shown in FIG. 18, that is, after the image shown in FIG. 15 is divided into 11 rectangles in the horizontal direction or in the width direction, assuming that there is a crack crossing the whole image from the lower left corner to the upper right corner, the shortest length of the crack in each divided region can be calculated to be about because the width and height of the original image are fixed and are a known valueThen the longitudinal crack height of each divided region is calculated by angle to be +.>Compared with the longitudinal cracks, the height occupied by the cracks obliquely crossing the whole image in each partition area is minimum, so that the cracks are screened by taking 25 as the minimum threshold value of the height of the connected domain circumscribed rectangle.
And S36, performing expansion processing on the sixth image to obtain a seventh image. Specifically, the sixth image is subjected to expansion processing according to a preset structural element, and a seventh image is obtained. The predetermined structural elements may be structural elements having a longitudinal height of 33 and a transverse width of 3. In this embodiment, the image shown in fig. 19 is obtained by performing the expansion processing on the image of fig. 17.
And S37, screening the connected domain of the seventh image, removing the filled full black background, and reducing the size of the seventh image to a preset size to obtain an eighth image. Specifically, the connected domain with the width of the transverse pixel smaller than a fourth preset value or larger than a fifth preset value in the seventh image is removed, wherein the fourth preset value is smaller than the fifth preset value. For example, if the connected domain having a width of the horizontal pixel of the connected domain smaller than 10 or larger than 100 in the image shown in fig. 19 is removed, the fourth preset value is set to 10, and the fifth threshold value is set to 100, thereby obtaining the image shown in fig. 20. The added 10-pixel wide full black background of fig. 20 is then removed and fig. 20 is restored to the size of the first image size, resulting in the image shown in fig. 21.
S38, determining whether a crack exists in the image to be detected according to the height-width ratio of the connected domain in the eighth image, and if so, marking the position of the crack in the image to be detected. For example, in fig. 21, a portion where the ratio of the height to the width of the connected domain is larger than 2 is calculated, and the portion is determined to be a crack as shown in fig. 22. And the crack location is marked with a rectangular box in fig. 4, resulting in an image as shown in fig. 23.
In the above embodiment, since the color of the concrete surface is gray, the gray interval distribution is narrow, the crack is not obvious, the texture is light, and the gray level is very different from the surrounding background, the gray histogram distribution of the whole image is a narrow and high single-peak form, which is also the main cause of difficult crack extraction. According to the embodiment, when the crack and the background are gradually separated, corresponding screening conditions are set according to the characteristics of the crack, such as the form, the geometry, the gray level and the like, and when the crack and the background are separated, the interference background in the crack image is continuously deleted, so that the separation effect of the crack background is enhanced, and the success rate of crack detection is improved.
As can be seen from the application of the embodiment to the experimental process, the nearest neighbor interpolation algorithm is performed on the image with the original image size being less than or equal to 3000 pixels and the width being less than or equal to 2000 pixels, so that the processing size designated by the application is reduced, and the crack detection effect is unchanged. However, since the crack detection effect is not good after the image with the original image size larger than the above limit is reduced, the effect is obvious by dividing such a large-size image, for example, vertically dividing it into three equal parts, then scaling the divided smaller-size image to a high 281 pixels and a wide 251 pixels, and finally performing the crack detection by using the method of the present embodiment. Specifically, for the original image of fig. 24 (a), after processing is performed by using the present embodiment, the detection result of fig. 24 (b) is obtained; processing is performed on the original image of fig. 25 (a) by using this embodiment, and then the detection result of fig. 25 (b) is obtained; processing is performed on the original image of fig. 26 (a) by using this embodiment, and then the detection result of fig. 26 (b) is obtained; processing is performed on the original image of fig. 27 (a) by using this embodiment, and the detection result of fig. 27 (b) is obtained; processing is performed on the original image of fig. 28 (a) by using this embodiment, and then the detection result of fig. 28 (b) is obtained; the detection result of fig. 29 (b) is obtained after the processing of the original image of fig. 29 (a) by the present embodiment. As can be seen from fig. 24 to fig. 29, the effect of the present embodiment in the actual detection process is remarkable.
In summary, the embodiment does not need to collect and make a large number of sample sets, is not limited to a specific application scene, does not need huge earlier-stage auxiliary work, and does not have application environment dependence. And the requirement on the image resolution is not high, and the current mainstream single phase inverter can meet the processing requirement. The single-lens reflex camera is economical in cost, moderate in size, convenient to carry, fixed and movable to photograph, and has stronger practical environmental adaptability and more convenient use. In addition, the method and the device improve crack identification accuracy and reduce algorithm complexity, so that average processing speed in an actual processing process can be effectively improved. Although the present embodiment is described with respect to cracks having a width of 0.5mm or less, the present embodiment is equally effective without modification and direct use for wider crack detection tasks.
The embodiment of the application provides a crack detection system for a building or a structure, which comprises the following components:
the pretreatment module is used for carrying out pretreatment on the acquired image to be detected to obtain a first image, wherein the image to be detected comprises an original image of the building or the structure;
the conversion module is used for converting the first image into a binary image, and screening out a part of the connected domain meeting the preset requirement from the binary image by adopting a preset rectangular window as a second image;
the first screening module is used for screening the connected domain of the second image to obtain a third image;
the segmentation module is used for segmenting the third image into a fourth image of preset equal parts, and filling a full black background in the middle of every two adjacent equal parts of the fourth image to obtain a fifth image;
the second screening module is used for screening the connected domain of the fifth image to obtain a sixth image;
the expansion processing module is used for carrying out expansion processing on the sixth image to obtain a seventh image;
the first screening module is used for screening the connected domain of the seventh image, removing the filled full black background, and reducing the size of the seventh image to a preset size to obtain an eighth image;
and the judging module is used for determining whether a crack exists in the image to be detected according to the height-width ratio of the connected domain in the eighth image, and if so, marking the position of the crack in the image to be detected.
The content of the method embodiment of the application is suitable for the system embodiment, the specific function of the system embodiment is the same as that of the method embodiment, and the achieved beneficial effects are the same as those of the method.
The embodiment of the application provides a crack detection device for a building or a structure, which comprises the following components:
at least one memory for storing a program;
at least one processor for loading the program to perform the crack detection method for a building or structure shown in fig. 1.
The content of the method embodiment of the application is suitable for the device embodiment, the specific function of the device embodiment is the same as that of the method embodiment, and the achieved beneficial effects are the same as those of the method.
An embodiment of the present application provides a storage medium in which a computer-executable program is stored, which when executed by a processor, is for implementing a crack detection method for a building or structure shown in fig. 1.
Embodiments of the present application also disclose a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions may be read from a computer-readable storage medium by a processor of a computer device, and executed by the processor, to cause the computer device to perform the method shown in fig. 1.
The embodiments of the present application have been described in detail with reference to the accompanying drawings, but the present application is not limited to the above embodiments, and various changes can be made within the knowledge of one of ordinary skill in the art without departing from the spirit of the present application. Furthermore, embodiments of the application and features of the embodiments may be combined with each other without conflict.
Claims (7)
1. A crack detection method for a building or structure, comprising the steps of:
preprocessing the acquired image to be detected to obtain a first image, wherein the image to be detected comprises an original image of the building or the structure;
converting the first image into a binary image, and screening out a part of the connected domain meeting preset requirements from the binary image by adopting a preset rectangular window as a second image;
screening the connected domain of the second image to obtain a third image;
dividing the third image into a fourth image of preset equal parts, and filling a full black background in the middle of every two adjacent equal parts of the fourth image to obtain a fifth image;
screening the connected domain of the fifth image to obtain a sixth image;
performing expansion processing on the sixth image to obtain a seventh image;
screening the connected domain of the seventh image, removing the filled full black background, and reducing the size of the seventh image to a preset size to obtain an eighth image;
determining whether a crack exists in the image to be detected according to the height-width ratio of the connected domain in the eighth image, and if so, marking the position of the crack in the image to be detected;
the filtering the connected domain of the second image to obtain a third image includes:
removing isolated points with the size of the connected domain being a first preset value on the second image to obtain a purified binary image;
determining that two different first communicating domains and second communicating domains exist in the purified binary image, and acquiring the maximum ordinate of the first communicating domain and the minimum ordinate of the second communicating domain;
determining that the difference value between the maximum ordinate and the minimum ordinate is equal to one pixel, and fusing the first connected domain and the second connected domain to obtain a fused image;
removing connected domains with the number of pixels smaller than a second preset value in the range of the four connected domains in the fused image to obtain a third image;
the filtering the connected domain of the fifth image to obtain a sixth image includes:
removing connected domains with the height of the external matrix smaller than a third preset value in the range of the eight connected domains in the fifth image to obtain a sixth image;
the filtering the connected domain of the seventh image includes:
and removing the connected domain with the width of the transverse pixel of the connected domain smaller than a fourth preset value or larger than a fifth preset value in the seventh image, wherein the fourth preset value is smaller than the fifth preset value.
2. The method for crack detection of a building or structure according to claim 1, wherein the preprocessing the acquired image to be detected to obtain a first image includes:
converting the image to be detected into a gray level image;
and scaling the gray level image to a preset size to obtain a first image.
3. The crack detection method for a building or structure according to claim 1, wherein the converting the first image into a binary image and screening out a portion of the binary image, which satisfies a preset requirement, as a second image by using a preset rectangular window, includes:
binarizing the pixel value on the right side of the first image to obtain a first binarized image;
screening out a part of the connected domain meeting the preset requirement from the first binarized image by adopting a preset rectangular window as a first connected domain image;
binarizing the left pixel value of the first image to obtain a second binarized image;
screening out a part of the connected domain meeting the preset requirement from the second binarized image by adopting a preset rectangular window as a second connected domain image;
performing logic union operation on the first connected domain image and the second connected domain image to obtain a third binarized image;
and screening out the part of the connected domain meeting the preset requirement from the third binarized image by adopting a preset rectangular window as a second image.
4. The crack detection method for a building or structure according to claim 1, wherein the expanding the sixth image to obtain a seventh image includes:
and performing expansion processing on the sixth image according to the preset structural elements to obtain a seventh image.
5. A crack detection system for a building or structure, comprising:
the pretreatment module is used for carrying out pretreatment on the acquired image to be detected to obtain a first image, wherein the image to be detected comprises an original image of the building or the structure;
the conversion module is used for converting the first image into a binary image, and screening out a part of the connected domain meeting the preset requirement from the binary image by adopting a preset rectangular window as a second image;
the first screening module is used for screening the connected domain of the second image to obtain a third image;
the segmentation module is used for segmenting the third image into a fourth image of preset equal parts, and filling a full black background in the middle of every two adjacent equal parts of the fourth image to obtain a fifth image;
the second screening module is used for screening the connected domain of the fifth image to obtain a sixth image;
the expansion processing module is used for carrying out expansion processing on the sixth image to obtain a seventh image;
the third screening module is used for screening the connected domain of the seventh image, removing the filled full black background, and reducing the size of the seventh image to a preset size to obtain an eighth image;
the judging module is used for determining whether a crack exists in the image to be detected according to the aspect ratio of the connected domain in the eighth image, and if so, marking the position of the crack in the image to be detected;
the filtering the connected domain of the second image to obtain a third image includes:
removing isolated points with the size of the connected domain being a first preset value on the second image to obtain a purified binary image;
determining that two different first communicating domains and second communicating domains exist in the purified binary image, and acquiring the maximum ordinate of the first communicating domain and the minimum ordinate of the second communicating domain;
determining that the difference value between the maximum ordinate and the minimum ordinate is equal to one pixel, and fusing the first connected domain and the second connected domain to obtain a fused image;
removing connected domains with the number of pixels smaller than a second preset value in the range of the four connected domains in the fused image to obtain a third image;
the filtering the connected domain of the fifth image to obtain a sixth image includes:
removing connected domains with the height of the external matrix smaller than a third preset value in the range of the eight connected domains in the fifth image to obtain a sixth image;
the filtering the connected domain of the seventh image includes:
and removing the connected domain with the width of the transverse pixel of the connected domain smaller than a fourth preset value or larger than a fifth preset value in the seventh image, wherein the fourth preset value is smaller than the fifth preset value.
6. A crack detection device for a building or structure, comprising:
at least one memory for storing a program;
at least one processor for loading the program to perform the crack detection method for a building or structure as claimed in any one of claims 1-4.
7. A storage medium having stored therein a computer executable program for implementing the crack detection method for a building or structure as claimed in any one of claims 1-4 when executed by a processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110850175.1A CN113658111B (en) | 2021-07-27 | 2021-07-27 | Crack detection method, system, device and medium for building or structure |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110850175.1A CN113658111B (en) | 2021-07-27 | 2021-07-27 | Crack detection method, system, device and medium for building or structure |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113658111A CN113658111A (en) | 2021-11-16 |
CN113658111B true CN113658111B (en) | 2023-12-12 |
Family
ID=78490696
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110850175.1A Active CN113658111B (en) | 2021-07-27 | 2021-07-27 | Crack detection method, system, device and medium for building or structure |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113658111B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104751443A (en) * | 2014-12-12 | 2015-07-01 | 郑州轻工业学院 | Cotton fault detecting and identifying method based on multi-spectrum technology |
CN106446905A (en) * | 2016-07-25 | 2017-02-22 | 广东省自动化研究所 | Surface crack texture extraction method based on fusion of seepage algorithm and adaptive Canny algorithm |
CN110163842A (en) * | 2019-04-15 | 2019-08-23 | 深圳高速工程检测有限公司 | Building cracks detection method, device, computer equipment and storage medium |
CN112330593A (en) * | 2020-10-10 | 2021-02-05 | 南京理工大学 | Building surface crack detection method based on deep learning network |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5328510B2 (en) * | 2009-06-24 | 2013-10-30 | キヤノン株式会社 | Image processing apparatus, image processing method, and computer program |
CN108364280B (en) * | 2018-01-03 | 2022-04-15 | 东南大学 | Method and equipment for automatically describing structural crack and accurately measuring width |
-
2021
- 2021-07-27 CN CN202110850175.1A patent/CN113658111B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104751443A (en) * | 2014-12-12 | 2015-07-01 | 郑州轻工业学院 | Cotton fault detecting and identifying method based on multi-spectrum technology |
CN106446905A (en) * | 2016-07-25 | 2017-02-22 | 广东省自动化研究所 | Surface crack texture extraction method based on fusion of seepage algorithm and adaptive Canny algorithm |
CN110163842A (en) * | 2019-04-15 | 2019-08-23 | 深圳高速工程检测有限公司 | Building cracks detection method, device, computer equipment and storage medium |
CN112330593A (en) * | 2020-10-10 | 2021-02-05 | 南京理工大学 | Building surface crack detection method based on deep learning network |
Non-Patent Citations (2)
Title |
---|
A Novel Road Crack Detection and Identification Method Using Digital Image Processing Techniques;Weiling Huang 等;《2012 7th International Conference on Computing and Convergence Technology》;第397-400页 * |
基于空间聚集特征的沥青路面裂缝检测方法;张德津 等;《自动化学报》;第42卷(第3期);第443-454页 * |
Also Published As
Publication number | Publication date |
---|---|
CN113658111A (en) | 2021-11-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107590470B (en) | Lane line detection method and device | |
CN111260616A (en) | Insulator crack detection method based on Canny operator two-dimensional threshold segmentation optimization | |
CN107045634B (en) | Text positioning method based on maximum stable extremum region and stroke width | |
CN111652296A (en) | Deep learning-based rail wagon lower pull rod fracture fault detection method | |
KR101717613B1 (en) | The moving vehicle detection system using an object tracking algorithm based on edge information, and method thereof | |
US20090202172A1 (en) | Image Inspection Apparatus, Image Inspection Method and Computer Program | |
CN111179232A (en) | Steel bar size detection system and method based on image processing | |
CN111415363A (en) | Image edge identification method | |
CN102175700A (en) | Method for detecting welding seam segmentation and defects of digital X-ray images | |
CN110309765B (en) | High-efficiency detection method for video moving target | |
CN113506246B (en) | Concrete 3D printing component fine detection method based on machine vision | |
CN108665464A (en) | A kind of foreign matter detecting method based on morphologic high tension electric tower and high-tension bus-bar | |
CN111401341B (en) | Deceleration strip detection method and device based on vision and storage medium thereof | |
CN112529853A (en) | Method and device for detecting damage of netting of underwater aquaculture net cage | |
CN106530292B (en) | A kind of steel strip surface defect image Fast Identification Method based on line scan camera | |
CN113658111B (en) | Crack detection method, system, device and medium for building or structure | |
CN115631198B (en) | Crack detection method and device for glass display screen and computer equipment | |
CN111354075A (en) | Foreground reduction interference extraction method in three-dimensional reconstruction | |
CN111179289A (en) | Image segmentation method suitable for webpage length and width images | |
CN113362347B (en) | Image defect region segmentation method and system based on super-pixel feature enhancement | |
CN116030430A (en) | Rail identification method, device, equipment and storage medium | |
CN105405109A (en) | Dirty spot detection method based on zonal background modeling | |
KR102585146B1 (en) | Pothole detection device and method based on deep learning | |
CN114596307A (en) | Method for measuring length of hanger of railway contact net based on unmanned aerial vehicle and machine vision | |
CN112241690A (en) | BIM-driven water delivery channel aerial image interest area extraction method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |