Method and device for identifying cracks in concrete dam body
By establishing a seed point matrix, a marker point matrix, and a weight coefficient matrix to identify cracks in concrete dams, the problems of low detection efficiency and high cost in existing methods have been solved, achieving efficient and low-cost crack detection and ensuring the health and safety of the dam body.
Patent Information
- Application Number
- CN202310203061.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-03
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2043-03-03
AI Technical Summary
Existing methods for detecting cracks in concrete dams are inefficient and costly, making them difficult to promote on a large scale in engineering projects.
By acquiring the grayscale image matrix of the concrete dam, a seed point matrix, a marker point matrix, and a weight coefficient matrix are established to identify crack areas.
It enables efficient and low-cost detection of cracks in concrete dams, supports full-cycle health monitoring of dams, and ensures safety.
Smart Images

Figure CN116205884B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of testing, in particular to a concrete dam crack identification method and device. BACKGROUND
[0002] The concrete crack is a phenomenon of physical structure change caused by environmental factors in the process of concrete construction or operation and maintenance. The generation of the concrete crack brings great safety hazards to the construction and operation and maintenance stage of the structure. With the increasing importance of water resources in the country, a large number of dam projects have been built in China, and the concrete dam is one of the common dam forms. At present, these concrete dams are in the operation and maintenance stage. The commonly used crack detection methods at the present stage are manual detection and non-destructive detection. The manual detection is restricted by working conditions and detection methods, and the detection efficiency is low. The non-destructive detection is restricted by detection materials and high equipment cost, and does not have the basic conditions for large-scale promotion in the engineering. Therefore, it is urgent to establish a low-cost and efficient concrete dam crack identification method to detect the health of the dam body in the whole cycle of construction, operation and maintenance, and provide protection for scientific evaluation of the health and safety of the dam body. SUMMARY
[0003] Therefore, the purpose of the present application is to provide a concrete dam crack identification method and device to alleviate the problems of low detection efficiency and high detection cost in the existing crack detection technology.
[0004] In a first aspect, the present application provides a concrete dam crack identification method, which comprises: acquiring a gray scale matrix of a first gray scale image of a concrete dam crack to be identified; establishing a seed point matrix based on the gray scale matrix; wherein the elements in the seed point matrix are the minimum values in the gray scale matrix; determining a first target pixel point in the first gray scale image based on the seed point matrix; establishing at least one marker point matrix based on the pixel position corresponding to the first target pixel point in the first gray scale image; wherein the element positions in the marker point matrix correspond one by one to the element positions in the gray scale matrix, the elements in the marker point matrix include a first value and a second value, and the first value is different from the second value; establishing a weight coefficient matrix based on the at least one marker point matrix; wherein the element positions in the weight coefficient matrix correspond one by one to the element positions in the gray scale matrix; determining a crack region in the first gray scale image based on the gray scale matrix and the weight coefficient matrix.
[0005] In a second aspect, the embodiments of the present application further provide a concrete dam crack identification device, which comprises: a first acquisition module, configured to acquire a gray matrix of a first gray image of a concrete dam crack to be identified; a first establishment module, configured to establish a seed point matrix based on the gray matrix; wherein an element in the seed point matrix is a minimum value in the gray matrix; a first determination module, configured to determine a first target pixel point in the first gray image based on the seed point matrix; a second establishment module, configured to establish at least one mark point matrix based on a pixel position corresponding to the first target pixel point in the first gray image; wherein an element position in the mark point matrix corresponds to an element position in the gray matrix one by one, and an element in the mark point matrix comprises a first value and a second value, and the first value is different from the second value; a third establishment module, configured to establish a weight coefficient matrix based on the at least one mark point matrix; wherein an element position in the weight coefficient matrix corresponds to an element position in the gray matrix one by one; and a second determination module, configured to determine a crack region in the first gray image based on the gray matrix and the weight coefficient matrix.
[0006] The concrete dam crack identification method and device provided by the embodiments of the present application first acquire a gray matrix of a first gray image of a concrete dam crack to be identified, and then establish a seed point matrix based on the gray matrix; then determine a first target pixel point in the first gray image based on the seed point matrix, and establish at least one mark point matrix based on a pixel position corresponding to the first target pixel point in the first gray image; then establish a weight coefficient matrix based on the at least one mark point matrix; and finally determine a crack region in the first gray image based on the gray matrix and the weight coefficient matrix. By using the above technology, the crack of the concrete dam can be detected only according to the first gray image, and the crack detection efficiency is relatively high, and the crack detection cost is relatively low, which is beneficial to health detection of the dam body in the whole cycle of construction, operation and maintenance, thereby providing protection for scientific evaluation of the health and safety of the dam body.
[0007] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art from the description, or can be learned by practice of the present application. The objects and other advantages of the present application will be realized and achieved by the structure particularly pointed out in the description, claims and drawings.
[0008] In order to make the above-mentioned objects, features and advantages of the present application more apparent, the following preferred embodiments are specifically described with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the specific embodiments or the prior art of the present application, the drawings needed to be used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0010] Figure 1 A flowchart of a concrete dam crack identification method in an embodiment of the present application is shown in the figure.
[0011] Figure 2 An example of a concrete dam surface image in an embodiment of the present application is shown in the figure.
[0012] Figure 3 An example of an image obtained after pre-processing of a concrete dam surface image in an embodiment of the present application is shown in the figure.
[0013] Figure 4 An example of a crack region when the dynamic threshold is 0.02 in an embodiment of the present application is shown in the figure.
[0014] Figure 5 An example of a crack region when the dynamic threshold is 0.05 in an embodiment of the present application is shown in the figure.
[0015] Figure 6 An example of a final crack region in an embodiment of the present application is shown in the figure.
[0016] Figure 7 A structural diagram of a concrete dam crack identification device in an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the present application will be described below in connection with the embodiments. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0018] At present, the commonly used crack detection methods include manual detection and non-destructive testing. The manual detection is restricted by working conditions and detection methods, and has low detection efficiency. The non-destructive testing is restricted by detection materials and high equipment cost, and does not have the basic conditions for large-scale promotion in engineering. Therefore, it is urgent to establish a low-cost and efficient concrete dam crack identification method to detect the health of the dam body throughout the whole cycle of construction, operation and maintenance, and to provide protection for scientific evaluation of the health and safety of the dam body.
[0019] Based on this, the concrete dam crack identification method and device provided by the embodiment can alleviate the problems of low detection efficiency and high detection cost in the existing crack detection technology.
[0020] To facilitate the understanding of the present embodiment, first, a concrete dam crack identification method disclosed by the present embodiment is introduced in detail, referring to Figure 1 The method can include the following steps:
[0021] Step S102, obtaining the gray matrix of the first gray image of the concrete dam crack to be identified.
[0022] Exemplarily, the corresponding gray image can be directly read from the electronic device pre-stored with the concrete dam surface gray image as the first gray image, or the concrete dam surface color image can be first collected by the image collection device and then pre-processed into the corresponding gray image as the first gray image; thus, the acquisition mode of the first gray image can be selected according to actual needs, which is not limited.
[0023] The gray matrix generally refers to the gray co-occurrence matrix, which is obtained by statistically analyzing the probability of two pixel points on the gray image having a certain gray value at a certain fixed distance, that is, all estimated probability values can be expressed in the form of a matrix, which is called a gray co-occurrence matrix. For example, take any pixel point (x, y) in the image (N x N) and another pixel point (x+a, y+b) deviating from it, and let the gray values of the pixel point pair be (g1, g2). Let the point (x, y) move in the entire image (N x N), then various (g1, g2) are obtained, and if the gray value series is k, then the combination of (g1, g2) is k 2 . For the entire image (N x N), the number of occurrences of each (g1, g2) is counted, and then arranged into a square matrix, and the total number of occurrences of (g1, g2) is normalized to the probability P(g1, g2) of occurrence. Such a square matrix is called a gray co-occurrence matrix; when a=1, b=0, the pixel point pair is horizontal, i.e. 0 degree scanning; when a=0, b=1, the pixel point pair is vertical, i.e. 90 degree scanning; when a=1, b=1, the pixel point pair is right diagonal, i.e. 45 degree scanning; when a=-1, b=1, the pixel pair is left diagonal, i.e. 135 degree scanning.
[0024] After obtaining the first gray image, the gray matrix of the first gray image can be obtained by directly performing gray matrix operation on the first gray image.
[0025] Step S104, establishing a seed point matrix based on the gray matrix; wherein the elements in the seed point matrix are the minimum values in the gray matrix.
[0026] Exemplarily, after obtaining the gray matrix of the first gray image, the element values in the gray matrix can be sorted in descending order or ascending order, and then one or more minimum values are found from the sorted results, and all the found values are combined to form the seed point matrix.
[0027] In step S106, the first target pixel points in the first gray image are determined based on the seed point matrix.
[0028] Exemplarily, after obtaining the seed point matrix, the pixel points corresponding to each element in the seed point matrix can be found from the first gray image as seed points, and then the corresponding pixel points meeting the preset condition in the respective neighborhood range of each seed point in the first gray image are searched as the first target pixel points, so that all the seed points in the first gray image plus all the first target pixel points contain all the crack information (also containing noise information) in the first gray image.
[0029] In step S108, at least one marker point matrix is established based on the pixel positions of the first target pixel points in the first gray image; wherein the element positions in the marker point matrix correspond one by one to the element positions in the gray matrix, and the elements in the marker point matrix include first values and second values, and the first values are different from the second values.
[0030] Exemplarily, after determining the first target pixel points meeting the preset condition in the first gray image, the first target pixel points in the first gray image are marked as the first values, and the gray values of the remaining pixel points other than the first target pixel points in the first gray image are marked as the second values, and then each first value and each second value is respectively taken as an element, and the pixel position of each first target pixel point in the first gray image is respectively taken as an element position, to generate a corresponding matrix as the marker point matrix, and the element positions in the marker point matrix correspond one by one to the element positions in the gray matrix. Similarly, multiple marker point matrices can be generated by changing the preset condition.
[0031] In step S110, a weight coefficient matrix is established based on the at least one marker point matrix; wherein the element positions in the weight coefficient matrix correspond one by one to the element positions in the gray matrix.
[0032] Exemplarily, after obtaining the at least one marker point matrix, the identification values (i.e. the first values or the second values) of the pixel points corresponding in the first gray image can be used to assign corresponding weight coefficients to the corresponding pixel points according to each marker point matrix, and then a corresponding weight coefficient matrix is generated for all the weight coefficients corresponding to each marker point matrix, so as to obtain the initial weight coefficient matrix corresponding to each marker point matrix, and then the initial weight coefficient matrices corresponding to each marker point matrix are fused into one weight coefficient matrix.
[0033] Step S112, based on the gray matrix and the weight coefficient matrix, determine the crack region in the first gray image.
[0034] Exemplarily, a new matrix can be obtained by multiplying the gray matrix and the weight coefficient matrix, and then the corresponding crack region in the first gray image is determined according to the value of each element in the new matrix.
[0035] The method provided by the embodiment of the application comprises the following steps: acquiring a gray matrix of a first gray image of a concrete dam body to be identified, and establishing a seed point matrix based on the gray matrix; determining a first target pixel point in the first gray image based on the seed point matrix, and establishing at least one mark point matrix based on a pixel position corresponding to the first target pixel point in the first gray image; then establishing a weight coefficient matrix based on the at least one mark point matrix; and finally determining a crack region in the first gray image based on the gray matrix and the weight coefficient matrix. According to the above technical solution, the cracks in the concrete dam body can be detected only based on the first gray image, and the crack detection efficiency is high and the crack detection cost is low, so that the health of the dam body can be detected in the whole cycle of construction, operation and maintenance, thereby providing a guarantee for scientifically evaluating the health and safety of the dam body.
[0036] As a possible implementation, the step S104 (i.e., establishing the seed point matrix based on the gray matrix) can comprise: determining the pixel point corresponding to the element with the minimum value in the gray matrix as the seed point, and establishing the seed point matrix based on the gray values of all the seed points in the first gray image.
[0037] After the element with the minimum value in the gray matrix is determined, the pixel point corresponding to the determined element in the first gray image can be determined as the seed point, then the gray values of all the seed points in the first gray image are composed into a column matrix, and the column matrix is recorded as the seed point matrix.
[0038] The number of seed points in the first gray image can be one or more, which is not limited.
[0039] As a possible implementation, the step S106 (i.e., determining the first target pixel point in the first gray image based on the seed point matrix) can comprise:
[0040] (11) For each seed point, the neighborhood pixel points above, below, left and right of the seed point and adjacent to the seed point in the first gray image are composed into a neighborhood pixel point set of the seed point.
[0041] For each seed point, the pixel points in the neighborhood range of the seed point in four directions of up, down, left and right can be searched in the first gray-scale image with the seed point as the starting point. In order to speed up the search progress, only the neighborhood pixel points above, below, left and right of the starting point (i.e. four-neighborhood pixel points) are searched, and the four neighborhood pixel points searched by each seed point form a corresponding neighborhood pixel point set.
[0042] (12) The neighborhood pixel point in the neighborhood pixel point set corresponding to each seed point that satisfies the following preset condition is determined as the first target pixel point:
[0043] P' mean -P mean ≤ P k
[0044] Wherein, P mean is the average value of the gray-scale values in the 3x3 neighborhood of the seed point, P' mean is the average value of the gray-scale values in the 3x3 neighborhood of the four-neighborhood pixel point, and P k is a dynamic threshold value; the smaller the value of P k is, the more crack information and noise information the first target pixel point determined under the P k contains.
[0045] For each seed point, after obtaining the neighborhood pixel point set composed of the four-neighborhood pixel points of the seed point, the gray-scale values of the seed point and each pixel point in the 3x3 neighborhood of the seed point except the seed point are respectively obtained, and the average value of the gray-scale values in the 3x3 neighborhood of the seed point is calculated according to the following formula: Wherein f(x n+i ,y n+j ) is the gray-scale value of the pixel point (x n ,y n ) in the 3x3 neighborhood of the seed point (x n+i ,y n+j ); then for each four-neighborhood pixel point in the neighborhood pixel point set, the gray-scale values of the four-neighborhood pixel point and each pixel point in the 3x3 neighborhood of the four-neighborhood pixel point except the four-neighborhood pixel point are respectively obtained, and the average value of the gray-scale values in the 3x3 neighborhood of the four-neighborhood pixel point is calculated according to the following formula: Wherein f(x m+i ,y m+j ) is the gray-scale value of the pixel point (x m ,y m ) in the 3x3 neighborhood of the four-neighborhood pixel point (x m+i ,y m+j ); then for each four-neighborhood pixel point in the neighborhood pixel point set, it is judged whether the four-neighborhood pixel point satisfies the following preset condition: P'mean -P mean ≤P k If the condition is met, the four-neighborhood pixel point can be determined as the first target pixel point, and in this way, all the first target pixel points in the first gray-scale image can be obtained.
[0046] As a possible implementation, the step S108 (i.e., establishing at least one marker point matrix based on the pixel position of the first target pixel point in the first gray-scale image) can include:
[0047] (21) Obtain a plurality of different dynamic thresholds.
[0048] (22) For each dynamic threshold, mark the gray-scale values of the first target pixel points and the remaining pixel points other than the first target pixel points in the first gray-scale image under the dynamic threshold as first values and second values, respectively.
[0049] (23) Generate a corresponding marker point matrix for the first values and the second values marked for each dynamic threshold based on the preset first matrix template, to obtain a plurality of marker point matrices.
[0050] The dynamic threshold can be set to zero point several according to actual conditions, which is not limited. Based on this, a plurality of different dynamic thresholds can be obtained by taking values multiple times within a value range.
[0051] For example, the first matrix template is set in advance according to the one-to-one correspondence between the empty element position and each element position in the gray-scale matrix. After determining all the first target pixel points under a certain dynamic threshold after the above step (12), the gray-scale values of the first target pixel points in the first gray-scale image under the dynamic threshold are marked as 0, and the gray-scale values of the remaining pixel points other than the first target pixel points in the first gray-scale image are marked as 255. Then, the first values and the second values marked for the dynamic threshold are filled into the first matrix template to obtain a marker point matrix. Then, the value of the dynamic threshold is changed, and the above steps (12) and (21) to (23) are repeatedly executed to obtain the marker point matrices under different dynamic thresholds.
[0052] As a possible implementation, the step S110 (i.e., establishing a weight coefficient matrix based on at least one marker point matrix) can include:
[0053] (31) Select the target marker point matrix corresponding to the minimum dynamic threshold from the plurality of marker point matrices, and obtain the pixel point region corresponding to the target marker point matrix in the first gray-scale image.
[0054] After obtaining the identification point matrix corresponding to each dynamic threshold, the identification point matrix corresponding to the minimum dynamic threshold can be taken as a target identification point matrix, and the pixel points corresponding to the target identification point matrix in the first gray-scale image are obtained. Then, a rectangular region corresponding to the horizontal coordinate range and the vertical coordinate range of the pixel points in the first gray-scale image is determined as a pixel point region in the first gray-scale image.
[0055] (32) For each pixel point in the pixel point region, a corresponding weight coefficient is assigned to the pixel point according to the number of times the pixel point is identified as the first value under all dynamic thresholds.
[0056] Specifically, for a pixel point in the pixel point region, if the pixel point is identified as the first value under each dynamic threshold, a first weight coefficient is assigned to the pixel point; if the pixel point is identified as the first value under part of the dynamic thresholds, a second weight coefficient is assigned to the pixel point; wherein the second weight coefficient is greater than the first weight coefficient; if the pixel point is identified as the second value under each dynamic threshold, a third weight coefficient is assigned to the pixel point; wherein the third weight coefficient is greater than the second weight coefficient. Continuing the previous example, for example, the gray-scale values of the first target pixel point and the remaining pixel points other than the first target pixel point in the first gray-scale image under each dynamic threshold are identified as 0 and 255 respectively, and the identification point matrix A corresponding to each dynamic threshold is generated accordingly. i After that, the pixel points corresponding to the corresponding identification point matrix in the first gray-scale image are denoted as A i (x, y), and the pixel point region corresponding to the target identification point matrix in the first gray-scale image (i.e. the range of the crack in the first gray-scale image) is denoted as Z. The weight of each pixel point corresponding to the target identification point matrix in the first gray-scale image can be assigned according to the following relationship:
[0057]
[0058] wherein w is the weight coefficient.
[0059] (33) A weight coefficient matrix is generated based on a preset second matrix template for the weight coefficients of all pixel points in the pixel point region.
[0060] For example, the second matrix template is set in advance according to the one-to-one correspondence between the empty element position and each element position in the gray-scale matrix. After obtaining the weight coefficients of all pixel points in the pixel point region, the obtained weight coefficients can be filled into the second matrix template to obtain a weight coefficient matrix.
[0061] As a possible implementation, the above step S112 (i.e. determining the crack region in the first gray-scale image based on the gray-scale matrix and the weight coefficient matrix) can include:
[0062] (41) multiplying the weight coefficient matrix by the gray matrix to obtain an optimization matrix.
[0063] (42) obtaining a second target pixel point in the first gray image corresponding to each element in the optimization matrix.
[0064] (43) for each element in the optimization matrix, if the element is less than a preset threshold, determining that the second target pixel point corresponding to the element belongs to a crack region.
[0065] (44) grouping all second target pixel points belonging to the crack region in the first gray image to form the crack region.
[0066] The preset threshold can be set according to actual needs, and is not limited.
[0067] The operation mode of steps (41) to (44) can further ensure the accuracy of non-crack region identification.
[0068] As a possible implementation, the concrete dam crack identification method can further include: obtaining an original color image of a concrete dam crack to be identified, and preprocessing the original color image to obtain a first gray image.
[0069] For example, after obtaining a three-channel original color image of a concrete dam crack to be identified, the original color image can be preprocessed into a corresponding gray image as the first gray image.
[0070] As a possible implementation, the concrete dam crack identification method can further include: for each seed point in the first gray image, updating the gray value of all first target pixel points corresponding to the seed point to the gray value of the seed point to obtain a second gray image.
[0071] The second gray image obtained by updating the gray value can further collect crack information in the gray image, thereby providing evidence for verifying the rationality of the crack region identified by the concrete dam crack identification method.
[0072] As a possible implementation, the concrete dam crack identification method can further include: setting a corresponding color and transparency for the crack region, and superimposing the crack region with the set color and transparency on the original color image.
[0073] For ease of understanding, the concrete dam crack identification method is described exemplarily as follows in a certain specific application:
[0074] Step one, image acquisition.
[0075] According to the engineering characteristics, an appropriate photogrammetry monitoring system can be established, and the surface images of the concrete dam (see FIG. 1) are collected in real time by the monitoring system to serve as the original data for crack identification. Figure 2
[0076] Step two, image preprocessing.
[0077] Image preprocessing refers to the process of processing the collected surface images of the concrete dam (i.e., the original color images). In the process of image collection, the quality of the images is inevitably affected by the collection equipment, environmental factors, etc. Image preprocessing can convert the collected color three-channel images into grayscale images (see FIG. 2) that can be used for subsequent crack identification. Figure 3
[0078] Step three, crack identification.
[0079] Crack identification refers to the process of identifying cracks in the preprocessed images, which can be performed according to the following operation mode:
[0080] (1) Read the preprocessed image (i.e., the grayscale image) and perform grayscale matrix operation on the image to obtain the grayscale matrix of the image. Then, sort the element values in the grayscale matrix from large to small to find one or more minimum values, and record all the found values as a column matrix as the seed point matrix.
[0081] (2) Take the pixel points corresponding to the seed point matrix in the preprocessed image as seed points. For each seed point, take it as the starting point to search for the pixel points in its neighborhood range in the first grayscale image. To speed up the search progress, four-neighborhood search can be used, i.e., only searching for the four-neighborhood pixel points above, below, left and right of the starting point. For each four-neighborhood pixel point found, determine whether it meets the above-mentioned preset condition (i.e., P' mean mean k ), if it meets the above-mentioned preset condition, update its pixel value to the pixel value of the starting point and mark the value of its pixel position in the grayscale image in the identification board as 0, if it does not meet the above-mentioned preset condition, update its pixel value to the pixel value of the starting point and mark the value of its pixel position in the grayscale image in the identification board as 255.
[0082] (3) After completing the four-neighborhood search of the starting point, iterate through the pixel points marked as 0 in the identification board according to step (2), and then generate an identification point matrix with the same dimension as the grayscale matrix for the identified 0 and 255. This matrix only contains two values, 0 and 255, where 0 indicates that the corresponding pixel point is preliminarily identified as belonging to the crack region, and 255 indicates that the corresponding pixel point is preliminarily identified as belonging to the non-crack region.
[0083] (4) change the value of P k , repeat steps (1) to (3), and obtain the identification point matrix A k under different dynamic threshold values P i .
[0084] (5) take the identification point matrix A k obtained when P i takes the minimum value as the target identification point matrix, determine the target identification point matrix corresponding to the pixel points in the gray image, and further obtain the horizontal coordinate range and the vertical coordinate range of each of the determined pixel points in the gray image (i.e. the range Z of the crack in the image; for each pixel point in the range Z, if the pixel point is identified as 0 under all dynamic thresholds, it means that the pixel point belongs to the crack region, and the pixel point can be assigned the highest weight (such as weight coefficient 0); if the pixel point is identified as 0 only under some dynamic thresholds, it means that the pixel point may belong to the crack region or the noise region, and the pixel point can be assigned an intermediate weight (such as weight coefficient 4); if the pixel point is identified as 255 under all dynamic thresholds, it means that the pixel point belongs to the crack region, and the pixel point can be assigned the lowest weight (such as weight coefficient 8). Referring to Figure 4 and Figure 5 , the crack region preliminarily identified when the dynamic threshold is 0.02 is shown, Figure 4 and the crack region preliminarily identified when the dynamic threshold is 0.05 is shown. Figure 5
[0085] (6) multiply the weight coefficient matrix by the gray matrix to obtain an optimized matrix, then obtain the pixel point corresponding to each element in the optimized matrix in the gray image, and perform a threshold judgment on each element in the optimized matrix, when the value of the element is less than the threshold, it can be determined that the corresponding pixel point belongs to the final crack region, and when the value of the element is greater than the threshold, it can be determined that the corresponding pixel point belongs to the final non-crack region. Referring to Figure 6 , the final crack region identified after the above steps one to three is shown. Figure 6
[0086] Step four, crack identification result display.
[0087] Taking the original color image as the base map, setting the display color and transparency of the identified crack region, and superimposing the identified crack region on the original color image, the crack region and the original color image are displayed at the same time.
[0088] Based on the above concrete dam crack identification method, the embodiment of the present application further provides a concrete dam crack identification device, referring to Figure 7 As shown, the apparatus can include the following modules:
[0089] The first acquisition module 702 is configured to acquire a gray matrix of a first gray image of a concrete dam body crack to be identified.
[0090] The first establishment module 704 is configured to establish a seed point matrix based on the gray matrix; wherein an element in the seed point matrix is a minimum value in the gray matrix.
[0091] The first determination module 706 is configured to determine a first target pixel point in the first gray image based on the seed point matrix.
[0092] The second establishment module 708 is configured to establish at least one mark point matrix based on a pixel position corresponding to the first target pixel point in the first gray image; wherein an element position in the mark point matrix corresponds to an element position in the gray matrix one by one, and an element in the mark point matrix includes a first value and a second value, and the first value is different from the second value.
[0093] The third establishment module 710 is configured to establish a weight coefficient matrix based on the at least one mark point matrix; wherein an element position in the weight coefficient matrix corresponds to an element position in the gray matrix one by one.
[0094] The second determination module 712 is configured to determine a crack region in the first gray image based on the gray matrix and the weight coefficient matrix.
[0095] The concrete dam body crack identification apparatus provided by the embodiment of the present application first acquires a gray matrix of a first gray image of a concrete dam body crack to be identified, and then establishes a seed point matrix based on the gray matrix; then determines a first target pixel point in the first gray image based on the seed point matrix, and establishes at least one mark point matrix based on a pixel position corresponding to the first target pixel point in the first gray image; then establishes a weight coefficient matrix based on the at least one mark point matrix; and finally determines a crack region in the first gray image based on the gray matrix and the weight coefficient matrix. By using the above technology, the crack of the concrete dam body can be detected only according to the first gray image, the crack detection efficiency is higher, the crack detection cost is lower, and the health detection of the dam body in the whole cycle of construction, operation and maintenance is facilitated, thereby providing protection for scientific evaluation of the health and safety of the dam body.
[0096] The first establishment module 704 can also be configured to determine a pixel point corresponding to an element with a minimum value in the gray matrix in the first gray image as a seed point, and establish the seed point matrix based on gray values of all seed points in the first gray image.
[0097] The first determining module 706 can also be configured to: for each seed point, form a set of neighborhood pixel points of the seed point by using the neighborhood pixel points of the seed point in the first gray-scale image and adjacent to the seed point above, below, left and right of the seed point; and determine a neighborhood pixel point in the set of neighborhood pixel points corresponding to each seed point as the first target pixel point if the neighborhood pixel point satisfies the following preset condition: P' mean -P mean ≤ P k ; wherein P mean is an average value of the gray-scale values of the seed point in a 3*3 neighborhood of the seed point, P mean is an average value of the gray-scale values of the four-neighborhood pixel point in a 3*3 neighborhood of the four-neighborhood pixel point, and P k is a dynamic threshold value.
[0098] The second establishing module 708 can also be configured to: obtain a plurality of different dynamic threshold values; for each dynamic threshold value, identify the gray-scale values of the first target pixel points and the remaining pixel points other than the first target pixel points in the first gray-scale image as a first value and a second value respectively under the dynamic threshold value; generate a corresponding marker matrix for the identified first value and second value corresponding to each dynamic threshold value based on a preset first matrix template, and obtain a plurality of marker matrices.
[0099] The third establishing module 710 can also be configured to: select a target marker matrix corresponding to a minimum dynamic threshold value from the plurality of marker matrices, and obtain a pixel point region in the first gray-scale image corresponding to the target marker matrix; for each pixel point in the pixel point region, assign a corresponding weight coefficient to the pixel point according to the number of times that the pixel point is identified as the first value under all dynamic threshold values; and generate the weight coefficient matrix for the weight coefficients of all pixel points in the pixel point region based on a preset second matrix template.
[0100] The third establishing module 710 can also be configured to: if the pixel point is identified as the first value under each dynamic threshold value, assign a first weight coefficient to the pixel point; if the pixel point is identified as the first value under part of the dynamic threshold values, assign a second weight coefficient to the pixel point; wherein the second weight coefficient is greater than the first weight coefficient; and if the pixel point is identified as the second value under each dynamic threshold value, assign a third weight coefficient to the pixel point; wherein the third weight coefficient is greater than the second weight coefficient.
[0101] The second determining module 712 can also be configured to: multiply the weight coefficient matrix by the gray matrix to obtain an optimization matrix; obtain a second target pixel point in the first gray image corresponding to each element in the optimization matrix; for each element in the optimization matrix, if the element is less than a preset threshold, it is determined that the second target pixel point corresponding to the element belongs to the crack region; and group all the second target pixel points belonging to the crack region in the first gray image to obtain the crack region.
[0102] The first obtaining module 702 can also be configured to: obtain an original color image of a concrete dam body crack to be identified, and pre-process the original color image to obtain the first gray image.
[0103] Referring to FIG. 7, Figure 7 The device can include:
[0104] The updating module 714 is configured to: for each seed point in the first gray image, update the gray value of all the first target pixel points corresponding to the seed point to the gray value of the seed point to obtain a second gray image.
[0105] The display module 716 is configured to: set a corresponding color and transparency for the crack region, and superimpose and display the crack region with the set color and transparency on the original color image.
[0106] The concrete dam body crack identification device provided in the embodiments of the present application has the same implementation principle and technical effects as the concrete dam body crack identification method described above, and for brevity, the part of the device embodiments not mentioned can refer to the corresponding content in the method embodiments described above.
[0107] Unless otherwise specified, the relative steps, numerical expressions and values of the components and steps set forth in these embodiments do not limit the scope of the present application.
[0108] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a nonvolatile computer readable storage medium executable by a processor. Based on this understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0109] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", "third" are only for the purpose of description, and cannot be understood as indicating or implying relative importance.
[0110] Finally, it should be noted that: the above-described embodiments are only specific embodiments of the present application, which are used to illustrate the technical solutions of the present application, and are not limited thereto, the protection scope of the present application is not limited thereto, although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art within the technical range disclosed by the present application can modify or easily think of changes to the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for identifying cracks in a concrete dam body, characterized by, The method comprises: acquiring a gray matrix of a first gray image of a concrete dam body crack to be identified; establishing a seed point matrix based on the gray matrix; wherein an element in the seed point matrix is a minimum value in the gray matrix; determining a first target pixel point in the first gray image based on the seed point matrix; establishing at least one mark point matrix based on a pixel position corresponding to the first target pixel point in the first gray image; wherein an element position in the mark point matrix corresponds to an element position in the gray matrix one by one, an element in the mark point matrix comprises a first value and a second value, and the first value is different from the second value; establishing a weight coefficient matrix based on the at least one mark point matrix; wherein an element position in the weight coefficient matrix corresponds to an element position in the gray matrix one by one; determining a crack region in the first gray image based on the gray matrix and the weight coefficient matrix; The step of determining the first target pixel point in the first gray-scale image based on the seed point matrix comprises: for each seed point, a neighborhood pixel point set of the seed point is formed by the neighborhood pixel points of the seed point above, below, left and right in the first gray-scale image; the neighborhood pixel point in the neighborhood pixel point set corresponding to each seed point that satisfies the following preset condition is determined as the first target pixel point: ; wherein, is the average value of the gray-scale values of the seed point in the neighborhood of the seed point, is the average value of the gray-scale values of the neighborhood pixel points in the neighborhood of the seed point, is the average value of the gray-scale values of the four-neighborhood pixel points in the neighborhood of the four-neighborhood pixel point, is the average value of the gray-scale values of the four-neighborhood pixel points in the neighborhood of the four-neighborhood pixel point, is a dynamic threshold value. the step of establishing at least one mark point matrix based on a pixel position corresponding to the first target pixel point in the first gray image comprises: acquiring a plurality of different dynamic thresholds; for each dynamic threshold, the gray values of the first target pixel point and the remaining pixel points other than the first target pixel point in the first gray image under the dynamic threshold are marked as a first value and a second value respectively; a corresponding mark point matrix is generated for the first value and the second value marked for each dynamic threshold based on a preset first matrix template, thereby obtaining a plurality of mark point matrices; the step of establishing a weight coefficient matrix based on the at least one mark point matrix comprises: screening out a target mark point matrix corresponding to a minimum dynamic threshold from the plurality of mark point matrices, and acquiring a pixel point region corresponding to the target mark point matrix in the first gray image; for each pixel point in the pixel point region, a corresponding weight coefficient is assigned to the pixel point according to the number of times that the pixel point is marked as the first value under all dynamic thresholds; the weight coefficient matrix is generated for the weight coefficients of all pixel points in the pixel point region based on a preset second matrix template.
2. The method of claim 1, wherein, the step of establishing a seed point matrix based on the gray matrix comprises: determining a pixel point corresponding to an element with a minimum value in the gray matrix in the first gray image as a seed point, and establishing the seed point matrix based on the gray values of all seed points in the first gray image.
3. The method of claim 2, wherein, the step of assigning a corresponding weight coefficient to the pixel point according to the number of times that the pixel point is marked as the first value under all dynamic thresholds comprises: if the pixel point is marked as the first value under each dynamic threshold, a first weight coefficient is assigned to the pixel point; if the pixel point is marked as the first value under part of the dynamic thresholds, a second weight coefficient is assigned to the pixel point; wherein the second weight coefficient is greater than the first weight coefficient; if the pixel point is marked as the second value under each dynamic threshold, a third weight coefficient is assigned to the pixel point; wherein the third weight coefficient is greater than the second weight coefficient.
4. The method of claim 2, wherein, the step of determining a crack region in the first gray image based on the gray matrix and the weight coefficient matrix comprises: multiplying the weight coefficient matrix by the gray matrix to obtain an optimization matrix; obtaining a second target pixel point corresponding to each element in the optimization matrix in the first gray image; for each element in the optimization matrix, if the element is less than a preset threshold, determining that the second target pixel point corresponding to the element belongs to a crack region; composing all second target pixel points belonging to the crack region in the first gray image into the crack region.
5. The method of claim 1, wherein, The method further comprises: obtaining an original color image of a concrete dam body crack to be identified, and preprocessing the original color image to obtain the first gray image.
6. The method of claim 2, wherein, The method further comprises: for each seed point in the first gray image, updating the gray values of all first target pixel points corresponding to the seed point to the gray value of the seed point to obtain a second gray image.
7. A concrete dam body crack recognition device characterized by comprising: a crack recognition device according to any one of claims 1 to 6; and a dam body crack recognition device according to any one of claims 1 to 6. The device comprises: a first obtaining module configured to obtain a gray matrix of a first gray image of a concrete dam body crack to be identified; a first establishing module configured to establish a seed point matrix based on the gray matrix; wherein an element in the seed point matrix is a minimum value in the gray matrix; a first determining module configured to determine first target pixel points in the first gray image based on the seed point matrix; a second establishing module configured to establish at least one marker point matrix based on pixel positions of the first target pixel points in the first gray image; wherein an element position in the marker point matrix corresponds to an element position in the gray matrix one by one, and an element in the marker point matrix comprises a first value and a second value, the first value being different from the second value; a third establishing module configured to establish a weight coefficient matrix based on the at least one marker point matrix; wherein an element position in the weight coefficient matrix corresponds to an element position in the gray matrix one by one; a second determining module configured to determine a crack region in the first gray image based on the gray matrix and the weight coefficient matrix; The first determining module is further configured to: for each seed point, group the neighboring pixel points of the seed point in the first gray-scale image above, below, left and right of the seed point and adjacent to the seed point into a set of neighboring pixel points of the seed point; and determine, as the first target pixel point, a neighboring pixel point in the set of neighboring pixel points corresponding to each seed point and satisfying the following preset condition: ; wherein, is an average value of the gray-scale values of the neighboring pixel points of the seed point in the neighborhood of the seed point, is an average value of the gray-scale values of the neighboring pixel points of the seed point in the neighborhood of the seed point, is an average value of the gray-scale values of the neighboring pixel points of the seed point in the neighborhood of the seed point, is an average value of the gray-scale values of the neighboring pixel points of the seed point in the neighborhood of the seed point, is a dynamic threshold value. the second establishing module is further configured to: obtain a plurality of different dynamic thresholds; for each dynamic threshold, mark the gray values of the first target pixel points and the remaining pixel points other than the first target pixel points in the first gray image under the dynamic threshold as the first value and the second value respectively; generate a corresponding marker point matrix for the first value and the second value corresponding to each dynamic threshold based on a preset first matrix template to obtain a plurality of marker point matrices; the third establishing module is further configured to: select a target marker point matrix corresponding to a minimum dynamic threshold from the plurality of marker point matrices, and obtain a pixel point region corresponding to the target marker point matrix in the first gray image; for each pixel point in the pixel point region, assign a corresponding weight coefficient to the pixel point according to the number of times that the pixel point is marked as the first value under all dynamic thresholds; generate the weight coefficient matrix for the weight coefficients of all pixel points in the pixel point region based on a preset second matrix template.
Citation Information
Patent Citations
Method for detecting fissure on surface of subway tunnel
CN103839268A
Automatic recognition and detection method of crack in grayscale image
CN107144572A