Precast pile surface defect detection method and related device
Through point cloud image processing technology, grayscale co-occurrence matrix and energy analysis, surface defects of precast piles can be automatically identified, solving the problem of reliance on manual identification and achieving efficient automated detection.
Patent Information
- Application Number
- CN202510888923.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-17
AI Technical Summary
In the existing technology, the detection of surface defects of precast piles relies on manual visual recognition and cannot meet the requirements of automation.
By acquiring the point cloud image of the precast pile, the surface defect area is automatically identified using the gray level co-occurrence matrix and energy analysis, including determining the gray level co-occurrence matrix, energy, texture anomaly and surface defect area of the point cloud image block.
It realizes the automatic detection of surface defect areas of precast piles without relying on manual labor, thus improving the detection efficiency and accuracy.
Smart Images

Figure CN120807431A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and particularly relates to a surface defect detection method for a precast pile and a related device. BACKGROUND
[0002] In the production process of a precast pile, a defect area such as a cement residue or unevenness existing on the surface of a preliminarily produced precast pile needs to be handled. For example, a defect area of unevenness on the surface of a precast pile needs to be ground.
[0003] At present, a defect area existing on the surface of a precast pile is mainly determined by a human eye, which cannot meet the requirement of automation. Therefore, how to detect a defect area on the surface of a precast pile without relying on a human being is a technical problem to be solved by those skilled in the art. SUMMARY
[0004] In view of the above problems, the present application provides a surface defect detection method for a precast pile and a related device, so as to detect area information of a defect area existing on the surface of a precast pile without relying on a human being.
[0005] In a first aspect, the present application provides a surface defect detection method for a precast pile, comprising:
[0006] obtaining a point cloud image of a precast pile;
[0007] respectively determining a gray level co-occurrence matrix corresponding to each point cloud image block in the point cloud image;
[0008] determining an energy corresponding to each point cloud image block based on the gray level co-occurrence matrix corresponding to the point cloud image block;
[0009] determining a target point cloud image block with abnormal texture based on the energy corresponding to each point cloud image block, the target point cloud image block belonging to the plurality of point cloud image blocks;
[0010] determining area information of a surface defect area in the precast pile corresponding to the target point cloud image block.
[0011] In a possible implementation manner of the first aspect, before respectively determining the gray level co-occurrence matrix corresponding to each point cloud image block in the point cloud image, the method further comprises:
[0012] determining a gray level co-occurrence matrix corresponding to the point cloud image;
[0013] determining an energy corresponding to the point cloud image based on the gray level co-occurrence matrix corresponding to the point cloud image;
[0014] The determining of the gray level co-occurrence matrix corresponding to each point cloud image block in the point cloud image comprises:
[0015] If the energy corresponding to the point cloud image is less than a first energy threshold, the gray level co-occurrence matrix corresponding to each point cloud image block in the point cloud image is determined respectively.
[0016] In a further possible implementation form of the first aspect, the determining of the target point cloud image block with abnormal texture based on the energy corresponding to each point cloud image block comprises:
[0017] The energy corresponding to each point cloud image block is normalized to obtain a normalized energy corresponding to each point cloud image block.
[0018] The point cloud image block with the normalized energy greater than a second energy threshold is determined as the target point cloud image block with abnormal texture.
[0019] In a further possible implementation form of the first aspect, the normalizing of the energy corresponding to each point cloud image block to obtain a normalized energy corresponding to each point cloud image block comprises:
[0020] The average value and the standard deviation of the energy corresponding to each point cloud image block are determined.
[0021] The energy of each point cloud image block is normalized based on the average value and the standard deviation to obtain a normalized energy corresponding to each point cloud image block.
[0022] In a further possible implementation form of the first aspect, before the determining of the gray level co-occurrence matrix corresponding to each point cloud image block in the point cloud image, the method further comprises:
[0023] The gray level co-occurrence matrix corresponding to the point cloud image is determined.
[0024] The entropy corresponding to the point cloud image is determined based on the gray level co-occurrence matrix corresponding to the point cloud image.
[0025] If the entropy corresponding to the point cloud image exceeds a set entropy threshold, the point cloud image is denoised based on a Gaussian function.
[0026] In a further possible implementation form of the first aspect, the denoising of the point cloud image based on the Gaussian function comprises:
[0027] The point cloud image is divided into a plurality of image blocks.
[0028] For each image block, a weighted value of each point in the image block relative to a center point in the image block is determined based on the Gaussian function.
[0029] For each image block, based on the weight values corresponding to the points in the image block, update the point data of the points in the image block.
[0030] In a further possible implementation form of the first aspect, the determining the area information of the surface defect region in the precast pile corresponding to the target point cloud image block comprises:
[0031] Determining at least one of the position coordinates, the area, the perimeter, the circularity, and the aspect ratio of the surface defect region in the precast pile corresponding to the target point cloud image block.
[0032] In a further possible implementation form of the first aspect, before respectively determining the gray level co-occurrence matrix corresponding to the plurality of point cloud image blocks in the point cloud image, the method further comprises:
[0033] Determining the plurality of point cloud image blocks from the point cloud image by using a sliding window.
[0034] In a further possible implementation form of the first aspect, the obtaining the point cloud image of the precast pile comprises:
[0035] Obtaining an initial point cloud image corresponding to the precast pile;
[0036] Determining an edge contour of the precast pile in the initial point cloud image based on an edge detection algorithm;
[0037] Performing inter-class variance processing on the points in the initial point cloud image that are within the edge contour of the precast pile to obtain a point cloud image belonging to the precast pile in the initial point cloud image.
[0038] In a further possible implementation form of the first aspect, the determining the edge contour of the precast pile in the initial point cloud image based on the edge detection algorithm comprises:
[0039] Performing Gaussian filtering processing on the initial point cloud image to obtain a denoised initial point cloud image;
[0040] Calculating gradient amplitudes and gradient directions corresponding to the denoised initial point cloud image;
[0041] Determining the edge contour of the precast pile in the denoised initial point cloud image based on the gradient amplitudes and the gradient directions.
[0042] In a further possible implementation form of the first aspect, the performing inter-class variance processing on the points in the initial point cloud image that are within the edge contour of the precast pile to obtain a point cloud image belonging to the precast pile in the initial point cloud image comprises:
[0043] performing inter-class variance processing on points in the initial point cloud image that are within an edge contour of the precast pile, to obtain a candidate point cloud image in the initial point cloud image that belongs to the precast pile;
[0044] performing denoising processing on the candidate point cloud image based on Fourier transform, to obtain a point cloud image corresponding to the precast pile.
[0045] In a second aspect, the present application provides a surface defect detection device for a precast pile, comprising:
[0046] an image obtaining unit configured to obtain a point cloud image of a precast pile;
[0047] a matrix determining unit configured to determine a gray level co-occurrence matrix corresponding to each point cloud image patch in the point cloud image;
[0048] an energy determining unit configured to determine an energy corresponding to each point cloud image patch based on the gray level co-occurrence matrix corresponding to the point cloud image patch;
[0049] an anomaly determining unit configured to determine a target point cloud image patch with abnormal texture based on the energy of each point cloud image patch, the target point cloud image patch belonging to the plurality of point cloud image patches;
[0050] a defect determining unit configured to determine region information of a surface defect region in the precast pile corresponding to the target point cloud image patch.
[0051] In a third aspect, the present application provides an electronic device, a memory and a processor;
[0052] the processor is configured to execute the surface defect detection method for a precast pile according to any one of the preceding aspects;
[0053] the memory is configured to store programs required by the processor for execution.
[0054] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium carrying one or more computer programs, when the one or more computer programs are executed by an electronic device, the electronic device can implement the surface defect detection method for a precast pile according to any one of the preceding aspects.
[0055] In a fifth aspect, the present application provides a computer program product, comprising computer readable instructions, when the computer readable instructions are run on an electronic device, the electronic device implements the surface defect detection method for a precast pile according to any one of the preceding aspects.
[0056] From the above, in the present application, after obtaining the point cloud image of the precast pile, the energy corresponding to each point cloud image block is determined based on the gray level co-occurrence matrix corresponding to the plurality of point cloud image blocks in the point cloud image of the precast pile. Since the energy of the point cloud image block can reflect the texture uniformity of the point cloud image block, based on this, the target point cloud image block with abnormal texture can be determined by combining the energy of each point cloud image block, and the information of the surface defect region in the precast pile corresponding to the target point cloud image block can be naturally determined, so that the surface region with defects in the precast pile can be detected without relying on manual work. BRIEF DESCRIPTION OF DRAWINGS
[0057] The above and other features, advantages, and aspects of the present disclosure will become more apparent as various embodiments of the present disclosure are described in conjunction with the following detailed description, taken in conjunction with the accompanying drawings. Throughout the drawings, like or similar reference numerals refer to like or similar elements. It should be understood that the drawings are schematic, and the sizes of the original and elements are not necessarily drawn according to the scale.
[0058] Figure 1 A flowchart of a surface defect detection method of a precast pile provided by the present application;
[0059] Figure 2 Another flowchart of a surface defect detection method of a precast pile provided by the present application;
[0060] Figure 3 Another flowchart of a surface defect detection method of a precast pile provided by the present application;
[0061] Figure 4 A component structure diagram of a surface defect detection device of a precast pile provided by the present application;
[0062] Figure 5 A component architecture diagram of an electronic device provided by the present application. DETAILED DESCRIPTION
[0063] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. The terms used in the embodiment part of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. Those skilled in the art can know that with the development of technology and the appearance of new scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0064] The terms "first", "second", and the like in the description and in the claims of the present application and above drawings are used for distinguishing between similar objects and not necessarily for describing a specific sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances and are merely employed for descriptive purposes. Furthermore, the terms "comprise", "include", "have" and any variations thereof are intended to cover a non-exclusive inclusion, such that processes, methods, systems, products, or apparatuses that comprise, include, have a list of elements can include additional elements not expressly listed or inherent to such processes, methods, systems, products, or apparatuses. Those having ordinary skill in the art will understand that information and signals can be represented using any of a variety of technologies and techniques. For the purposes of this disclosure, the terms "information" and "signal" can be used interchangeably.
[0065] As Figure 1 , a surface defect detection method of a precast pile is shown, the scheme provided by the present application can be applied to an electronic device, which can be a personal computer or a server with image processing capability, etc., and the specific limitation is not added. The method of the embodiment can include:
[0066] S101, obtaining a point cloud image of a precast pile.
[0067] The point cloud image of the precast pile can be obtained by laser radar or camera, etc. to collect point cloud data of the precast pile.
[0068] S102, respectively determining the gray level co-occurrence matrix corresponding to each point cloud image block in the point cloud image.
[0069] The point cloud image block is a block of the point cloud image, and the plurality of point cloud image blocks can completely cover the point cloud image.
[0070] In the present application, the specific division method of the plurality of point cloud image blocks in the point cloud image can have multiple possibilities, and the specific limitation is not added.
[0071] For example, in a possible implementation, in order to ensure that the block size of each point cloud image block is more uniform, and the texture condition of different surface regions of the precast pile can be more comprehensively reflected through the plurality of point cloud image blocks, in the present application, a sliding window can be used to determine the plurality of point cloud image blocks from the point cloud image. The size of the sliding window can be selected according to actual needs, and the specific limitation is not added.
[0072] When using a sliding window to determine point cloud image blocks from the point cloud image, the sliding window can be slid according to a set sliding step length. The length of the sliding step length can be equal to the width of the sliding window. In this case, the point cloud image blocks determined from the point cloud image using the sliding window do not have image overlap areas, and the multiple point cloud image blocks determined just constitute the point cloud image. The length of the sliding window can also be less than the width of the sliding window. In this case, each point cloud image block determined from the point cloud image using the sliding window has an overlapping image area with the point cloud image block determined previously, which can effectively reduce the situation where the point cloud image blocks cannot fully cover a single surface defect area of the precast pile.
[0073] The Gray-Level Co-occurrence Matrix (GLCM) corresponding to a point cloud image block refers to the gray-level co-occurrence matrix of the grayscale image corresponding to the point cloud image block. The gray-level co-occurrence matrix corresponding to a point cloud image block can reflect the texture distribution characteristics of the point cloud image block in the global scope.
[0074] For example, for a grayscale image of any image (the image can be any image, such as a point cloud image block or a point cloud image), under a given direction θ and distance d, the element P(i,j,d,θ) of the grayscale co-occurrence matrix represents the pixel I(x i ,y i ) and the pixel I(x j ,y j ) is expressed as follows:
[0075]
[0076] Wherein, the distance between two pixels in a pixel pair is d, and the angle between the two pixels in the pixel pair and the horizontal axis is θ; #{} represents statistics, that is, the number of pixel pairs that meet the conditions in {}. In this application, i and j represent any two different grayscale values, and the values of i and j can be natural numbers from 0 to L-1, where L is the maximum grayscale level of the image. Among them, the element P(i,j,d,θ) of the grayscale co-occurrence matrix can also be abbreviated as P(i,j). N total is the total number of pixel pairs in the grayscale image.
[0077] In practical applications, the gray-level co-occurrence matrix can also be normalized to obtain a normalized gray-level co-occurrence matrix. Accordingly, in this application, the gray-level co-occurrence matrix corresponding to the point cloud image or the point cloud image block mentioned can be a normalized gray-level co-occurrence matrix.
[0078] S103, for each point cloud image block, determining the energy corresponding to the point cloud image block based on the gray level co-occurrence matrix corresponding to the point cloud image block.
[0079] It can be understood that based on the gray level co-occurrence matrix corresponding to the image, a plurality of texture features of the image can be extracted, wherein the plurality of texture features include: energy, contrast, entropy and homogeneity of the image. It can be seen that after obtaining the gray level co-occurrence matrix corresponding to the point cloud image block, the energy corresponding to the point cloud image block can be extracted.
[0080] Wherein, the energy corresponding to the point cloud image block can be used to measure the texture uniformity of the point cloud image block, the greater the value of the energy of the point cloud image block, the more uniform the gray scale distribution of the gray scale image corresponding to the point cloud image block, that is, the more uniform the texture of the point cloud image block.
[0081] In order to facilitate understanding of the specific implementation of determining various texture features based on the gray level co-occurrence matrix and the meaning expressed by the various texture features extracted, the following describes the formula that can be used to determine the energy, contrast, entropy and homogeneity of the image based on the gray level co-occurrence matrix and the meaning of each texture feature:
[0082] Wherein, based on the gray level co-occurrence matrix, the energy Energy corresponding to the image (such as the image can be a point cloud image block) can be obtained by the following formula two:
[0083]
[0084] As described above, P(i,j) represents an element in the gray level co-occurrence matrix. The energy can be used to measure the uniformity of the texture corresponding to the image, wherein the greater the value of the energy, the more uniform the texture distribution of the image.
[0085] Based on the gray level co-occurrence matrix, the contrast Contrast corresponding to the image can be obtained by the following formula three:
[0086]
[0087] Wherein, the contrast can reflect the local gray scale difference of the image, the greater the value of the contrast, the more obvious the texture of the image.
[0088] Based on the gray level co-occurrence matrix, the entropy Entropy corresponding to the image can be obtained by the following formula four:
[0089]
[0090] Wherein, the entropy is used to describe the texture complexity corresponding to the image, the greater the value of the entropy, the higher the randomness of the texture.
[0091] Based on the gray level co-occurrence matrix, the homogeneity corresponding to the image can be obtained by the following formula five:
[0092]
[0093] Wherein, the homogeneity is used to measure the local gray similarity corresponding to the image, and the greater the value of the homogeneity, the smoother the texture of the image.
[0094] S104, based on the energy corresponding to each point cloud image block, determine the target point cloud image block with abnormal texture.
[0095] Wherein, the target point cloud image block belongs to a plurality of point cloud image blocks. In this application, in order to distinguish, the point cloud image block with abnormal texture is called target point cloud image block. Wherein, the number of target point cloud image blocks can be one or more, when the number of defective areas in the precast pile to be detected is different, the number of target point cloud image blocks determined will also be different.
[0096] It can be understood that, since the energy corresponding to the point cloud image block can represent the texture uniformity corresponding to the point cloud image block, and different point cloud image blocks correspond to different areas in the point cloud image of the precast pile, therefore, if there is no cement residue and other defects on the surface of the precast pile, the energy corresponding to each point cloud image block will be similar. Correspondingly, if the energy of a part of point cloud image blocks is greatly different from that of most of the other point cloud image blocks, it means that the texture of the part of point cloud image blocks is abnormal.
[0097] Wherein, the specific implementation of determining the target point cloud image block based on the energy corresponding to each point cloud image block can be various, which is not limited.
[0098] For example, this application can cluster based on the energy of each point cloud image block to obtain at least one cluster, and each cluster includes at least one point cloud image block. On this basis, if a cluster includes only one or a small number of point cloud image blocks, it means that the texture uniformity of the point cloud image blocks in the cluster is greatly different from that of other point cloud images. Based on this, the target cluster with the number of point cloud image blocks less than the set number can be determined, and the point cloud image blocks in the target cluster are determined as the target point cloud image blocks with abnormal texture.
[0099] For example, an energy threshold for determining whether a point cloud image block has texture abnormality can also be obtained, which can be pre-set according to experience or determined in combination with the energy of each point cloud image block. There is no specific limitation. On this basis, if the energy of a point cloud image block is greater than the energy threshold, the point cloud image block is determined as a target point cloud image block with texture abnormality.
[0100] Further, in order to more accurately determine the target point cloud image block with texture abnormality, the energy of each point cloud image block can also be normalized in the present application to obtain the normalized energy of each point cloud image block. Then, the point cloud image block with normalized energy greater than the set energy threshold can be determined as the target point cloud image block with texture abnormality.
[0101] The normalization of the energy of each point cloud image block can be implemented by using any general normalization method. In an optional manner, the present application can determine the mean value and standard deviation of the energy of each point cloud image block, and normalize the energy of each point cloud image block based on the mean value and standard deviation to obtain the normalized energy of each point cloud image block. For example, the normalized energy of a point cloud image block is Energy 标准 The following formula six can be used to obtain:
[0102]
[0103] wherein, Energy 分块 represents the energy of the point cloud image block (i.e. the energy without normalization), E pj is the mean value of the energy of each point cloud image block, E bzc represents the standard deviation of the energy of each point cloud image block.
[0104] S105, determining the area information of the surface defect region in the precast pile corresponding to the target point cloud image block.
[0105] It can be understood that each point in the point cloud image of the precast pile corresponds to a point on the precast pile, and the target point cloud image block also has a corresponding relationship with the corresponding region in the point cloud image of the precast pile. Based on this, after the target point cloud image block is determined, the surface defect region on the precast pile corresponding to the target point cloud image block can be determined.
[0106] In the present application, the area information of the surface defect region in the precast pile corresponding to the target point cloud image block can be one or more information related to the surface defect region, without specific limitation.
[0107] For example, in order to more efficiently locate the surface defect area in the precast pile, the surface defect area can include the position coordinates of the surface defect area. The position coordinates of the surface defect area can be used to locate the surface defect area on the precast pile, so as to perform defect repair processing on the surface defect area, etc.
[0108] For another example, considering that the target point cloud image block has a position corresponding relationship with the surface of the precast pile, after the target point cloud image block is determined, the user can locate the surface defect area of the precast pile, but the area size and shape of the surface defect area and other characteristics will affect the repair method of the surface defect area. Based on this, in order to more reasonably determine the repair method required to repair the surface defect area in the precast pile, etc., the area information of the surface defect area in the present application can be at least one of the area, the perimeter, the circularity and the aspect ratio of the surface defect area.
[0109] Of course, the area information of the surface defect area corresponding to the target point cloud image block can also include at least one of the above-mentioned position coordinates, area, perimeter, circularity and aspect ratio.
[0110] Among them, the area, the perimeter, the circularity and the aspect ratio of the surface defect area can be consistent with the area, the perimeter, the circularity and the aspect ratio of the target point cloud image block respectively, therefore, the present application can determine the area, the perimeter, the circularity and the aspect ratio of the target point cloud image block. Determining the area, the perimeter, the circularity and the aspect ratio of the target point cloud image block can adopt any technical implementation manner for determining the area, the perimeter, the circularity and the aspect ratio of the image, which is not limited in particular.
[0111] For example, the present application can determine the area, the perimeter, the circularity and the aspect ratio of the surface defect area corresponding to the target point cloud image block based on the following formulas respectively:
[0112] Among them, the area Area of the surface defect area corresponding to the target point cloud image block can be calculated by the following formula seven:
[0113]
[0114] Among them, (x, y) represents any one point in the target point cloud image block (for example, when the target point cloud image is a two-dimensional image, each point is a pixel point), and R is a set of all points in the target point cloud image block.
[0115] In formula seven, each point corresponds to a unit area, and all points contained in the target point cloud image block are counted to obtain the area corresponding to the target point cloud image block composed of the unit area corresponding to all points.
[0116] wherein the perimeter L of the surface defect region corresponding to the target point cloud image block 周长 The area A of the surface defect region corresponding to the target point cloud image block can be calculated by the following formula eight:
[0117]
[0118] wherein xk is the horizontal coordinate of the kth point on the edge in the target point cloud image block, yk is the vertical coordinate of the kth point on the edge in the target point cloud image block, and k is a natural number ranging from 1 to K, wherein K is the total number of points on the edge in the target point cloud image block. k k
[0119] The circularity Circularity of the surface defect region corresponding to the target point cloud image block can be calculated by the following formula nine:
[0120]
[0121] wherein the value of the circularity ranges from 0 to 1, and the closer the value of the circularity to 1, the closer the shape of the surface defect region to a circle.
[0122] The aspect ratio Aspect Ratio of the surface defect region corresponding to the target point cloud image block can be calculated by the following formula ten:
[0123]
[0124] wherein Δx and Δy represent the maximum span of the target point cloud image in the horizontal coordinate direction and the vertical coordinate direction, respectively.
[0125] It can be understood that the above is an example of calculating the area, perimeter, circularity, and aspect ratio of the surface defect region corresponding to the target point cloud image, but if the above parameters are calculated by other methods, they are also applicable to the present application.
[0126] It can be understood that in the case where there are multiple target point cloud image blocks, the area information of the surface defect region in the precast pile corresponding to each target point cloud image block can be determined respectively.
[0127] From the above, in the present application, after obtaining the point cloud image of the precast pile, the energy corresponding to each point cloud image block is determined based on the gray level co-occurrence matrix corresponding to the plurality of point cloud image blocks in the point cloud image of the precast pile. Since the energy of the point cloud image block can reflect the texture uniformity of the point cloud image block, based on this, the target point cloud image block with abnormal texture can be determined by combining the energy of each point cloud image block, and the information of the surface defect region corresponding to the target point cloud image block in the precast pile can be determined, so that the surface region with defects in the precast pile can be detected without relying on manual operation.
[0128] It can be understood that if the production process of the precast pile meets the requirements, there may be no surface defect region with defects on the precast pile. In order to reduce the data processing amount required for surface defect detection of the precast pile and improve the accuracy of surface defect detection, the present application can determine the gray level co-occurrence matrix corresponding to the point cloud image before determining the gray level co-occurrence matrix corresponding to the plurality of point cloud image blocks, and determine the energy corresponding to the point cloud image based on the gray level co-occurrence matrix corresponding to the point cloud image.
[0129] Among them, the gray level co-occurrence matrix of the point cloud image can be the gray level co-occurrence matrix of the gray image corresponding to the point cloud image, which can be referred to the previous introduction of constructing the gray level co-occurrence matrix. Correspondingly, the energy of the point cloud image based on the gray level co-occurrence matrix of the point cloud image can also be referred to the previous introduction of extracting texture features based on the gray level co-occurrence matrix, which will not be repeated here.
[0130] It can be understood that since the energy of the point cloud image can represent the uniformity of the texture distribution of the point cloud image, if the precast pile does not have a surface defect region, the texture distribution uniformity of the point cloud image of the precast pile will be higher, and correspondingly, the energy corresponding to the point cloud image will also be relatively large. Therefore, the present application can analyze whether the surface of the precast pile has the risk or possibility of having a surface defect region based on the energy of the point cloud image.
[0131] Correspondingly, if the energy of the point cloud image is less than the first energy threshold, the present application will determine the gray level co-occurrence matrix corresponding to the plurality of point cloud image blocks in the point cloud image. Among them, the first energy threshold can be set according to actual needs. The energy of the point cloud image less than the first energy threshold can indicate that the texture distribution uniformity of the point cloud image does not meet the requirements, which means that the surface of the precast pile has the risk of having a surface defect region.
[0132] In the present application, in order to distinguish the energy threshold for judging whether the texture distribution of the point cloud image meets the uniformity requirement is called the first energy threshold, and the energy threshold for judging whether the texture of the point cloud image block is abnormal is called the second energy threshold.
[0133] It can be understood that dust cannot be avoided in the production site of the precast pile. If the amount of dust in the production environment of the precast pile is too large, it will cause interference noise in the collected point cloud image due to too much dust, which may affect the determination of the surface defect area. Based on this, in order to reduce the influence of too much environmental dust on the accuracy of the surface defect detection of the precast pile, the present application can also determine the gray level co-occurrence matrix corresponding to the point cloud image of the precast pile before determining the gray level co-occurrence matrix corresponding to the plurality of point cloud image blocks. Based on the gray level co-occurrence matrix corresponding to the point cloud image, the entropy corresponding to the point cloud image is determined. Correspondingly, if the entropy corresponding to the point cloud image exceeds the set entropy threshold, the point cloud image is denoised based on the Gaussian function.
[0134] Wherein, the specific implementation of determining the gray level co-occurrence matrix of the point cloud image and the entropy corresponding to the point cloud image can be referred to the previous relevant introduction, which will not be repeated here.
[0135] It can be understood that if the entropy corresponding to the point cloud image is determined before the gray level co-occurrence matrix of the point cloud image is constructed, such as, in order to calculate the energy corresponding to the point cloud image, the gray level co-occurrence matrix of the point cloud image has been determined, it is not necessary to generate the gray level co-occurrence matrix corresponding to the point cloud image repeatedly.
[0136] Wherein, the entropy of the point cloud image can indicate the texture complexity of the point cloud image, therefore, if the amount of dust in the production environment of the precast pile is too high, the texture complexity of the obtained point cloud image of the precast pile will also be high due to the influence of dust, which naturally means that the point cloud image of the precast pile contains more noise introduced by dust. On this basis, in the case that the entropy corresponding to the point cloud image exceeds the set entropy threshold, the present application denoises the point cloud image based on the Gaussian function, which can effectively reduce the influence of the dust attached to the surface of the precast pile on the surface defect detection of the precast pile, and is beneficial to improve the accuracy of the surface defect detection.
[0137] Wherein, there are many possible implementations of denoising the point cloud image based on the Gaussian function, which will be introduced below taking one possible implementation as an example. For example Figure 2 , another flowchart of the surface defect detection method of the precast pile provided by the present application is shown, the method of the present embodiment can comprise:
[0138] S201, obtaining a point cloud image of a precast pile.
[0139] S202 , determining a gray level co-occurrence matrix corresponding to the point cloud image, and determining energy and entropy corresponding to the point cloud image based on the gray level co-occurrence matrix corresponding to the point cloud image.
[0140] S203, if the energy corresponding to the point cloud image is less than the first energy threshold, determine whether the entropy corresponding to the point cloud image exceeds the set entropy threshold, if yes, execute step S204; if no, execute step S206.
[0141] It is understood that if the entropy corresponding to the point cloud image exceeds the set entropy threshold, it indicates that the amount of environmental dust in the production site where the precast piles are located is high, resulting in the presence of noise in the point cloud image that affects defect detection. Therefore, step S204 needs to be executed to remove the noise introduced by the dust interference. Conversely, if the entropy corresponding to the point cloud image does not exceed the entropy threshold, the noise introduced by the environmental dust interference in the point cloud image is relatively low, and denoising is not required. Therefore, step S206 and subsequent related defect area detection processes can be directly executed based on the point cloud image.
[0142] It should be noted that, in this embodiment, the surface defect area in the precast pile will be determined based on the point cloud image only when the energy corresponding to the point cloud image is less than the first energy threshold (i.e., the risk of determining the existence of a surface defect area with defects in the precast pile) is taken as an example. Therefore, only when the energy corresponding to the point cloud image is less than the first energy threshold will it be determined whether the entropy of the point cloud image exceeds the set entropy threshold.
[0143] However, it is understandable that if instead of judging whether the energy corresponding to the point cloud image is less than the first energy threshold, it is directly judged whether the entropy corresponding to the point cloud image exceeds the entropy threshold in order to determine whether it is necessary to remove the noise introduced into the point cloud image due to dust, it is also applicable to the present embodiment.
[0144] S204 , dividing the point cloud image into a plurality of image blocks, and for each image block, determining a weighted value of each point in the image block relative to a center point in the image block based on a Gaussian function.
[0145] The purpose of dividing the point cloud image into multiple image blocks is to perform denoising on each image block one by one, so as to eventually complete the overall denoising of the point cloud image.
[0146] The specific method for dividing the point cloud image into multiple image blocks can be selected as needed. Some of the multiple image blocks may have overlapping areas, or alternatively, none of the image blocks may have overlapping areas, without any specific limitation. The size and number of the divided image blocks may also vary depending on the number of points in the point cloud image, without any specific limitation.
[0147] wherein, for any one image block, the center point of the image block is a point located at the center position, such as a pixel point located at the center position.
[0148] Based on the Gaussian function, the weight value w of any one point in the image block relative to the center point in the image block can be obtained by the following formula eleven:
[0149]
[0150] wherein, p represents the coordinate position of any one point in the image block, p zhong represents the coordinate position of the center point in the image block, ||p-p zhong || represents the Euclidean distance of the point in the image block relative to the center point. σ represents the Gaussian kernel width, used to control the attenuation speed of the weight.
[0151] S205, based on the weight value corresponding to each point in the image block, updating the point data of each point in the image block to obtain the updated point cloud image of each image block.
[0152] wherein, the specific implementation of updating the point data of each point in the image block based on the weight value corresponding to each point in the image block can be various, which is not limited in the present application.
[0153] For example, if there is an overlapping area between each image block, then for each point in the point cloud image, based on the weight value of the point in different image blocks, the point data (such as coordinates and pixels, etc.) of the point is recalculated, so as to realize the update of each point in the point cloud image, and achieve the purpose of noise suppression.
[0154] S206, using a sliding window to determine a plurality of point cloud image blocks from the point cloud image, and determining the corresponding gray level co-occurrence matrix of each point cloud image block.
[0155] In the present embodiment, in order to facilitate understanding, the determination of the point cloud image block from the point cloud image by the sliding window is taken as an example for illustration, but the way of determining a plurality of point cloud image blocks by other ways can also be applied to the present embodiment, which will not be described in detail.
[0156] S207, for each point cloud image block, based on the corresponding gray level co-occurrence matrix of the point cloud image block, determining the corresponding energy of the point cloud image block.
[0157] S208, determining the average value and the standard deviation corresponding to the energy of each point cloud image block, and based on the average value and the standard deviation, respectively normalizing the energy of each point cloud image block to obtain the corresponding normalized energy of each point cloud image block.
[0158] S209, determining the point cloud image patch with the normalized energy greater than the second energy threshold as the target point cloud image patch with texture abnormality.
[0159] The target point cloud image patch belongs to a plurality of point cloud image patches of the point cloud image.
[0160] It can be understood that, in order to facilitate understanding of the scheme, the above steps S208 and S209 are described by taking an implementation manner of determining the target point cloud image patch with texture abnormality based on the energy of each point cloud image patch as an example, but if the target point cloud image patch is determined by other manners mentioned in the foregoing embodiments, it is also applicable to the present application, and details are not repeated.
[0161] S210, determining the area information of the surface defect region of the precast pile corresponding to the target point cloud image patch.
[0162] For example, the area information of the surface defect region corresponding to the target point cloud image patch can include at least one of the position coordinates, area, perimeter, circularity, and aspect ratio of the surface defect region.
[0163] In any one of the above embodiments of the present application, in order to reduce the complexity of detecting the surface defects of the precast pile, the point cloud image of the precast pile can be a point cloud image containing only points belonging to the precast pile. Based on this, after obtaining the initial point cloud image corresponding to the precast pile, the present application can determine the edge contour of the precast pile in the initial point cloud image by an edge detection algorithm. Then, the points in the initial point cloud image within the edge contour of the precast pile are processed by inter-class variance to obtain the point cloud image belonging to the precast pile in the initial point cloud image.
[0164] The edge detection algorithm can be various, and the present application does not limit the specific edge detection algorithm used. For example, the edge detection algorithm can be a Canny operator-based edge detection algorithm, or other edge detection algorithms, which are not limited in detail.
[0165] It can be understood that, by processing the points in the initial point cloud image within the edge contour of the precast pile by inter-class variance, the points within the edge contour of the precast pile and belonging to the background can be effectively eliminated, and the points belonging to the precast pile are retained.
[0166] The following takes an implementation manner of determining the contour edge of the initial point cloud image by an edge detection algorithm, and eliminating the points within the contour edge and belonging to the background by inter-class variance as an example for description. For example Figure 3 , shows another flowchart of the surface defect detection method of the precast pile provided by the present application. The method of the present embodiment can include:
[0167] S301, obtain an initial point cloud image corresponding to the precast pile.
[0168] It can be understood that the initial point cloud image may contain point cloud data of the background and the like in addition to the points belonging to the precast pile.
[0169] S302, Gaussian filtering is performed on the initial point cloud image to obtain a denoised initial point cloud image.
[0170] In this embodiment, by performing Gaussian filtering on the initial point cloud image, noise in the initial point cloud image can be removed to determine the correctness of the gradient direction and the reliability of the gradient amplitude calculated based on the initial point cloud image subsequently.
[0171] As can be seen, Gaussian filtering can be performed on each point in the initial point cloud image by using a Gaussian filtering function shown in Equation Twelve as follows:
[0172]
[0173] In Equation Twelve, (x, y) represents any one point (which can also be regarded as the coordinates of the point) in the initial point cloud image, and in Equation Twelve, x also represents the distance of the point in the horizontal direction from the center of the Gaussian function, and y also represents the distance of the point in the column direction (or row direction) of the initial point cloud image from the center of the Gaussian function.
[0174] G(x, y) is the output of (x, y) after Gaussian filtering; and σ is the Gaussian kernel width.
[0175] S303, calculate the gradient amplitude and gradient direction corresponding to the denoised initial point cloud image.
[0176] The gradient amplitude and gradient direction corresponding to the initial point cloud image include the gradient direction and gradient direction corresponding to each point in the initial point cloud image.
[0177] As can be seen, the Sobel operator can be used to calculate the gradient amplitude and gradient direction of the denoised initial point cloud image.
[0178] The horizontal direction gradient G x and the vertical direction gradient G y corresponding to the initial point cloud image can be calculated by Equations Thirteen and Fourteen, respectively, as follows:
[0179]
[0180] wherein m and n are integers with values of -1 to 1.S x and S yrespectively represent different Sobel operator templates. I(x, y) is an input function of the initial point cloud image, which is used to describe a pixel, such as brightness or color intensity, of the initial point cloud image at a spatial position (x, y) (or a point (x, y)).
[0181] The horizontal direction gradient G x and the vertical direction gradient G y The gradient amplitude G and the gradient direction θ of the initial point cloud image can be calculated by the following formula fifteen and formula sixteen respectively:
[0182]
[0183] In actual application, the gradient direction is discretized into a limited number of main directions, such as 0°, 45°, 90°, and 135°, to simplify the calculation.
[0184] S304, based on the gradient amplitude and the gradient direction, the edge contour of the precast pile in the denoised initial point cloud image is determined.
[0185] For example, based on the gradient amplitude and the gradient direction of each point (such as each pixel point) in the initial point cloud image, non-maximum suppression (NMS) and double-threshold hysteresis processing are used to determine the points in the initial point cloud image that belong to the edge, and the edge contour composed of the points belonging to the edge is obtained.
[0186] The above steps S302 to S304 are described by taking an implementation manner of determining the edge contour of the precast pile in the initial point cloud image based on an edge detection algorithm as an example. If other edge detection algorithms are used to determine the edge contour of the precast pile, they are also applicable to the present embodiment.
[0187] S305, the points in the initial point cloud image that are within the edge contour of the precast pile are subjected to inter-class variance processing, and a candidate point cloud image belonging to the precast pile in the initial point cloud image is obtained.
[0188] For example, the initial point cloud image can be subjected to inter-class variance processing of Otsu threshold segmentation to determine the best segmentation threshold. Based on the segmentation threshold, the target object (such as the precast pile) and the background in the gray-scale image (such as a gray-scale histogram) corresponding to the initial point cloud image are separated, and then the points belonging to the target object in the gray-scale image are mapped to the point cloud image to obtain the candidate point cloud image belonging to the precast pile. Of course, considering that the point cloud image also needs to be converted to a gray-scale image when the point cloud image of the precast pile is processed subsequently, the present application can also directly use the gray-scale image subjected to inter-class variance processing as the candidate point cloud image.
[0189] The following is an example of inter-class variance processing for Otsu threshold segmentation of an initial point cloud image:
[0190] The number of pixels of each gray level in the initial point cloud image corresponding gray image is counted to generate a histogram H(g), where g∈[0, L-1], and L is the maximum gray level of the initial point cloud image corresponding histogram as described above. For each candidate threshold t∈[0, L-1], the following operations are performed:
[0191] First, the pixels in the histogram corresponding to the initial point cloud image are divided into two classes, one class is the pixel belonging to the background class, including: the pixel whose gray value is not less than t; the other class is the pixel belonging to the target class, including: the pixel whose gray value is greater than t.
[0192] Second, the class probabilities ω0(t) and ω1(t) of the two classes are calculated respectively using formulas seventeen and eighteen as follows:
[0193]
[0194] ω1(t)=1-ω0(t) (Equation eighteen);
[0195] where N 总 is the total number of pixels in the histogram.
[0196] Third, the class means μ0(t) and μ1(t) of the two classes are calculated respectively using formulas nineteen and twenty as follows:
[0197]
[0198] Then, the inter-class variance σ 2 (t) between the two classes is calculated using formula twenty-one as follows:
[0199] σ 2 (t)=ω0(t)·ω1(t)·[μ0(t)-μ1(t)] 2 (Equation twenty-one);
[0200] Finally, the optimal threshold t * is found based on formula twenty-two as follows:
[0201]
[0202] On this basis, based on the optimal threshold, the points in the initial point cloud image corresponding to the gray image belonging to the precast pile are determined and mapped into the initial point cloud image, thereby obtaining a candidate point cloud image composed of points belonging to the precast pile in the initial point cloud image.
[0203] S306, denoising the candidate point cloud image based on the Fourier transform to obtain the point cloud image corresponding to the precast pile.
[0204] For the convenience of understanding, the process of denoising the image (which can be a candidate point cloud image) based on the Fourier transform is briefly described as follows:
[0205] First, the image f(x, y) is multiplied by (-1) x+y The image can be centered (i.e., a translation transformation), and the two-dimensional discrete Fourier transform formula shown in Equation 23 is used to transform the centered image f(x, y) to obtain the transformed frequency domain image F(u, v) (also referred to as a frequency domain complex matrix):
[0206]
[0207] where M and N represent the number of rows and columns of the image, i.e., the width and height of the image; u and v represent the vertical and horizontal coordinates in the frequency domain, respectively, and the u coordinate corresponds to the number of rows of the transformed matrix, which is related to N; the v coordinate corresponds to the number of columns of the transformed matrix, which is related to M.
[0208] Second, an ideal low-pass filter H(u, v) is constructed as shown in Equation 24:
[0209]
[0210] where D0 is the cutoff frequency of the ideal low-pass filter.
[0211] Then, the ideal low-pass filter H(u, v) is multiplied point by point with the frequency domain image F(u, v) to suppress noise according to Equation 25 to obtain the filtered frequency domain image G(u, v):
[0212] G(u, v) = F(u, v) · H(u, v) (Equation 25);
[0213] Finally, the filtered frequency domain image is inverse discrete Fourier transformed according to Equation 26 to obtain the denoised image g(x, y):
[0214]
[0215] It should be noted that this step S306 is an optional step to reduce noise in the candidate point cloud image. Of course, in actual application, this step can also not be performed, and the candidate point cloud image can be directly used as the point cloud image corresponding to the precast pile and the subsequent step S307 can be performed.
[0216] S307, respectively determine the gray level co-occurrence matrix corresponding to each of the plurality of point cloud image blocks in the point cloud image.
[0217] S308, for each point cloud image block, determine the energy corresponding to the point cloud image block based on the gray level co-occurrence matrix corresponding to the point cloud image block.
[0218] S309, determine the target point cloud image block with abnormal texture based on the energy corresponding to each point cloud image block.
[0219] The target point cloud image block belongs to the plurality of point cloud image blocks.
[0220] S310, determine the area information of the surface defect region in the precast pile corresponding to the target point cloud image block.
[0221] The above steps S307 to S310 can refer to the related introduction of the foregoing Figure 1 and Figure 2 embodiments, which will not be repeated here.
[0222] Corresponding to the surface defect detection method of the precast pile provided in the present application, the present application also provides a surface defect detection device of a precast pile.
[0223] As Figure 4 shown in FIG. 1, a schematic structural diagram of a surface defect detection device of a precast pile provided by the present application is shown, and the device of the present embodiment can include:
[0224] The image obtaining unit 401 is configured to obtain a point cloud image of a precast pile.
[0225] The matrix determining unit 402 is configured to respectively determine the gray level co-occurrence matrix corresponding to each of the plurality of point cloud image blocks in the point cloud image.
[0226] The energy determining unit 403 is configured to determine the energy corresponding to each point cloud image block based on the gray level co-occurrence matrix corresponding to the point cloud image block.
[0227] The abnormality determining unit 404 is configured to determine the target point cloud image block with abnormal texture based on the energy of each point cloud image block, and the target point cloud image block belongs to the plurality of point cloud image blocks.
[0228] The defect determining unit 405 is configured to determine the area information of the surface defect region in the precast pile corresponding to the target point cloud image block.
[0229] In a possible implementation, the surface defect detection device of the precast pile can further include:
[0230] The gray level co-occurrence determination unit is configured to determine a gray level co-occurrence matrix corresponding to the point cloud image before the matrix determination unit determines the gray level co-occurrence matrices corresponding to the plurality of point cloud image patches in the point cloud image respectively.
[0231] The comprehensive energy determination unit is configured to determine an energy corresponding to the point cloud image based on the gray level co-occurrence matrix corresponding to the point cloud image.
[0232] The matrix determination unit is specifically configured to determine the gray level co-occurrence matrices corresponding to the plurality of point cloud image patches in the point cloud image respectively if the energy corresponding to the point cloud image is less than a first energy threshold.
[0233] In another possible implementation manner, the anomaly determination unit comprises:
[0234] The normalization sub-unit is configured to perform normalization processing on the energy corresponding to each point cloud image patch to obtain a normalized energy corresponding to each point cloud image patch.
[0235] The anomaly determination sub-unit is configured to determine a point cloud image patch with a normalized energy greater than a second energy threshold as a target point cloud image patch with texture anomaly.
[0236] In another possible implementation manner, the normalization sub-unit comprises:
[0237] The reference value determination sub-unit is configured to determine an average value and a standard deviation corresponding to the energy of each point cloud image patch.
[0238] The standard processing sub-unit is configured to normalize the energy of each point cloud image patch based on the average value and the standard deviation to obtain the normalized energy corresponding to each point cloud image patch.
[0239] In another possible implementation manner, the surface defect detection apparatus further comprises:
[0240] The gray level co-occurrence determination unit is configured to determine a gray level co-occurrence matrix corresponding to the point cloud image before the matrix determination unit determines the gray level co-occurrence matrices corresponding to the plurality of point cloud image patches in the point cloud image respectively.
[0241] The entropy determination unit is configured to determine an entropy corresponding to the point cloud image based on the gray level co-occurrence matrix corresponding to the point cloud image.
[0242] The Gaussian denoising unit is configured to perform denoising on the point cloud image based on a Gaussian function if the entropy corresponding to the point cloud image exceeds a set entropy threshold.
[0243] In another possible implementation manner, the Gaussian denoising unit comprises:
[0244] an image division subunit, configured to divide the point cloud image into a plurality of image blocks;
[0245] a weight determination subunit, configured to determine, for each image block, a weight value of each point in the image block relative to a center point in the image block based on a Gaussian function;
[0246] a Gaussian denoising subunit, configured to update, for each image block, point data of each point in the image block based on the weight value corresponding to the point.
[0247] In yet another possible implementation, the defect determination unit comprises:
[0248] a defect determination subunit, configured to determine at least one of a position coordinate, an area, a perimeter, a circularity, and an aspect ratio of a surface defect region of the precast pile corresponding to the target point cloud image block.
[0249] In yet another possible implementation, the surface defect detection apparatus further comprises:
[0250] a block processing unit, configured to determine a plurality of point cloud image blocks from the point cloud image by using a sliding window before the matrix determination unit determines a plurality of gray level co-occurrence matrices corresponding to the plurality of point cloud image blocks in the point cloud image.
[0251] In yet another possible implementation, the image obtaining unit comprises:
[0252] an initial acquisition subunit, configured to obtain an initial point cloud image corresponding to the precast pile;
[0253] an edge detection subunit, configured to determine an edge contour of the precast pile in the initial point cloud image based on an edge detection algorithm;
[0254] an image processing subunit, configured to perform inter-class variance processing on points in the initial point cloud image within the edge contour of the precast pile, to obtain a point cloud image belonging to the precast pile in the initial point cloud image.
[0255] In a possible implementation, the edge detection subunit comprises:
[0256] a filtering subunit, configured to perform Gaussian filtering processing on the initial point cloud image, to obtain a denoised initial point cloud image;
[0257] a gradient calculation subunit, configured to calculate a gradient amplitude and a gradient direction corresponding to the denoised initial point cloud image;
[0258] an edge determination subunit, configured to determine the edge contour of the precast pile in the denoised initial point cloud image based on the gradient amplitude and the gradient direction.
[0259] In yet another possible implementation, the image processing subunit comprises:
[0260] an inter-class processing subunit configured to perform inter-class variance processing on points in the initial point cloud image that are within an edge contour of the precast pile, to obtain a candidate point cloud image belonging to the precast pile in the initial point cloud image;
[0261] a transform processing subunit configured to perform denoising processing on the candidate point cloud image based on Fourier transform, to obtain the point cloud image corresponding to the precast pile.
[0262] The present application also provides an electronic device. As shown in the figure, it shows a component structure diagram of the electronic device, which at least includes a processor 501 and a memory 502; Figure 5
[0263] The processor 501 is configured to execute the precast pile surface defect detection method according to any one of the above embodiments.
[0264] The memory 502 is configured to store programs required by the processor for operation.
[0265] It can be understood that the electronic device can also include a display unit 503 and an input unit 504.
[0266] Of course, the electronic device can also have more or less components, and there is no limitation in this regard. Figure 5
[0267] The present application also provides a computer program product, which includes computer readable instructions, when the computer readable instructions run on an electronic device, make the electronic device realize any one of the precast pile surface defect detection methods provided by the present application.
[0268] The present application also provides a computer readable storage medium, which carries one or more computer programs, when the one or more computer programs are executed by an electronic device, can make the electronic device realize any one of the precast pile surface defect detection methods provided by the present application.
[0269] In addition, it should be noted that the apparatus embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment. In addition, the connection relationship between the modules in the apparatus embodiments provided in the present application indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines.
[0270] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be realized by means of software and the necessary general hardware, and of course can also be realized by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. Generally, functions completed by computer programs can be easily realized by corresponding hardware, and the specific hardware structure for realizing the same function can also be various, such as analog circuit, digital circuit or special circuit, etc. However, for the present application, software program implementation is a better embodiment. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products, which are stored in readable storage media, such as computer floppy disks, U disks, mobile hard disks, ROM, RAM, magnetic or optical disks, etc., including a plurality of instructions for making a computer device (which can be a personal computer, a training device, or a network device, etc.) execute the methods described in various embodiments of the present application.
[0271] In the above embodiments, all or part can be realized by software, hardware, firmware or any combination thereof. When realized by software, it can be realized in the form of a computer program product in whole or in part.
[0272] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, training device or data center to another website, computer, training device or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be stored by the computer or a data storage device such as a training device, a data center, etc. integrated with one or more available media sets. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)), etc.
Claims
1. A method for detecting surface defects of precast piles, characterized in that: include: Obtaining point cloud images of precast piles; respectively determining gray-level co-occurrence matrices corresponding to a plurality of point cloud image blocks in the point cloud image; Determining the energy corresponding to the point cloud image block based on the gray level co-occurrence matrix corresponding to the point cloud image block; determining, based on the energy corresponding to each point cloud image block, a target point cloud image block having an abnormal texture, the target point cloud image block belonging to the multiple point cloud image blocks; Determine the area information of the surface defect area in the prefabricated pile corresponding to the target point cloud image block.
2. The method for detecting surface defects of precast piles according to claim 1, characterized in that: Before respectively determining the gray level co-occurrence matrices corresponding to the plurality of point cloud image blocks in the point cloud image, the method further includes: Determine a gray level co-occurrence matrix corresponding to the point cloud image; Determining the energy corresponding to the point cloud image based on a gray-level co-occurrence matrix corresponding to the point cloud image; The respectively determining gray level co-occurrence matrices corresponding to a plurality of point cloud image blocks in the point cloud image includes: If the energy corresponding to the point cloud image is less than a first energy threshold, gray level co-occurrence matrices corresponding to a plurality of point cloud image blocks in the point cloud image are determined respectively.
3. The surface defect detection method of precast piles according to claim 1 or 2, characterized in that: The step of determining a target point cloud image block having abnormal texture based on the energy corresponding to each point cloud image block includes: The energy corresponding to each point cloud image block is normalized to obtain the normalized energy corresponding to each point cloud image block; The point cloud image block whose normalized energy is greater than the second energy threshold is determined as a target point cloud image block with abnormal texture.
4. The method for detecting surface defects of precast piles according to claim 3, characterized in that: The normalizing process of the energy corresponding to each point cloud image block to obtain the normalized energy corresponding to each point cloud image block includes: Determine the mean value and standard deviation of the energy corresponding to each point cloud image block; Based on the average value and the standard deviation, the energy of each point cloud image block is standardized to obtain the standardized energy corresponding to each point cloud image block.
5. The method for detecting surface defects of precast piles according to claim 1, characterized in that: Before respectively determining the gray level co-occurrence matrices corresponding to the plurality of point cloud image blocks in the point cloud image, the method further includes: Determine a gray level co-occurrence matrix corresponding to the point cloud image; Determining the entropy corresponding to the point cloud image based on a gray-level co-occurrence matrix corresponding to the point cloud image; If the entropy corresponding to the point cloud image exceeds a set entropy threshold, the point cloud image is denoised based on a Gaussian function.
6. The method for detecting surface defects of precast piles according to claim 5, characterized in that: The denoising of the point cloud image based on a Gaussian function includes: Dividing the point cloud image into a plurality of image blocks; For each image block, determining a weighted value of each point in the image block relative to a center point in the image block based on a Gaussian function; For each image block, point data of each point in the image block is updated based on the weighted value corresponding to each point in the image block.
7. The method for detecting surface defects of precast piles according to claim 1, characterized in that: The determining of the area information of the surface defect area in the prefabricated pile corresponding to the target point cloud image block includes: Determine at least one of the position coordinates, area, perimeter, circularity, and aspect ratio of a surface defect region in the prefabricated pile corresponding to the target point cloud image block.
8. The method for detecting surface defects of precast piles according to claim 1 or 2, characterized in that: Before respectively determining the gray level co-occurrence matrices corresponding to the plurality of point cloud image blocks in the point cloud image, the method further includes: A plurality of point cloud image blocks are determined from the point cloud image using a sliding window.
9. The method for detecting surface defects of precast piles according to claim 1, characterized in that: The step of obtaining a point cloud image of a prefabricated pile comprises: Obtaining the initial point cloud image corresponding to the precast pile; Determining the edge contour of the precast pile in the initial point cloud image based on an edge detection algorithm; Inter-class variance processing is performed on points of the initial point cloud image that are within the edge contour of the precast pile to obtain a point cloud image belonging to the precast pile in the initial point cloud image.
10. The method for detecting surface defects of precast piles according to claim 9, characterized in that: The step of determining the edge contour of the precast pile in the initial point cloud image based on an edge detection algorithm includes: Performing Gaussian filtering on the initial point cloud image to obtain a denoised initial point cloud image; Calculating the gradient magnitude and gradient direction corresponding to the denoised initial point cloud image; Based on the gradient amplitude and gradient direction, the edge contour of the precast pile in the denoised initial point cloud image is determined.
11. The method for detecting surface defects of precast piles according to claim 9, characterized in that: The performing inter-class variance processing on the points of the initial point cloud image that are within the edge contour of the precast pile to obtain the point cloud image belonging to the precast pile in the initial point cloud image includes: performing inter-class variance processing on points of the initial point cloud image that are within the edge contour of the precast pile to obtain candidate point cloud images belonging to the precast pile in the initial point cloud image; The candidate point cloud image is denoised based on Fourier transform to obtain a point cloud image corresponding to the precast pile.
12. A surface defect detection device for precast piles, characterized in that: include: An image acquisition unit, used for acquiring a point cloud image of the precast pile; a matrix determination unit, configured to respectively determine gray-level co-occurrence matrices corresponding to a plurality of point cloud image blocks in the point cloud image; an energy determination unit, configured to determine the energy corresponding to the point cloud image block based on the gray-level co-occurrence matrix corresponding to the point cloud image block; an abnormality determination unit, configured to determine a target point cloud image block having an abnormal texture based on the energy of each point cloud image block, wherein the target point cloud image block belongs to the plurality of point cloud image blocks; The defect determination unit is used to determine the area information of the surface defect area in the prefabricated pile corresponding to the target point cloud image block.
13. An electronic device, characterized in that: memory and processor; The processor is configured to execute the surface defect detection method for precast piles according to any one of claims 1 to 11; The memory is used to store programs required by the processor to perform operations.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the surface defect detection method for precast piles according to any one of claims 1 to 11.
15. A computer program product, characterized in that The method comprises computer-readable instructions, which, when executed on an electronic device, enable the electronic device to implement the method for detecting surface defects of precast piles according to any one of claims 1 to 11.