A building surface defect detection method based on image recognition
Patent Information
- Application Number
- CN202512025427.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2045-12-30
AI Technical Summary
同时,绿植阴影会随着太阳高度角变化、风力摆动等因素在时间维度上产生位置和形态的动态变化,而传统基于单帧或少量静态图像的图像识别系统难以感知和利用这种时间特性,从而容易将瞬时阴影误判为结构性缺陷,导致误检率显著升高
本发明能够在复杂外部环境下实现对建筑物表面缺陷的更可靠识别与分类,尤其适用于老旧小区高层外墙周边存在绿植遮挡和光影变化频繁的应用场景。通过对候选区域在时间维度上的存在特性进行分析,本发明能够对明显具有瞬时性和偶发性的干扰区域进行有效排除;同时,对于仅凭时间特征难以明确区分的候选区域,进一步从空间一致性角度对其进行判断,使候选区域是否源于建筑物表面真实结构变化得到更准确的刻画。该判断机制能够反映候选区域对建筑物表面整体几何连续性的影响程度,从而使真实缺陷与仅改变表观特征的干扰区域在判定结果上呈现出清晰差异。通过将时间特性与空间稳定性相结合,本发明使候选区域的分类结果更加符合建筑物表面的客观状态,减少因光照变化、绿植投影等环境因素带来的误判情况。同时,本发明能够将被判定为静态缺陷的区域准确映射至建筑物表面的实际位置,为后续的维护、评估和管理提供可靠依据,整体提升了建筑物表面缺陷检测在实际工程场景中的适用性与结果可信度。
Smart Images

Figure CN121837758B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and more specifically to a method for detecting surface defects in buildings based on image recognition. Background Technology
[0002] In routine safety inspections of the exterior walls of high-rise buildings in older residential communities, automated detection of surface defects using image recognition technology has become an important method. However, in practical applications, this type of detection faces significant technical challenges, especially in older residential communities surrounded by dense greenery.
[0003] Under sunlight, the greenery surrounding the exterior walls of old buildings (such as tall trees, ivy, or outstretched branches) casts numerous linear or blocky shadows on the wall surface. These shadows often exhibit elongated, irregular, and continuously distributed characteristics, and their width, direction, and grayscale variations closely resemble real defects such as minor cracks or hollow edges in the exterior walls. Furthermore, the position and shape of these plant shadows dynamically change over time due to factors such as variations in the sun's altitude angle and wind swaying. Traditional image recognition systems based on single frames or a small number of static images struggle to perceive and utilize this temporal characteristic, easily misjudging momentary shadows as structural defects, leading to a significantly higher false detection rate. Summary of the Invention
[0004] The purpose of this invention is to provide a method for detecting surface defects in buildings based on image recognition, thereby solving the aforementioned technical problems.
[0005] The objective of this invention can be achieved through the following technical solutions: A method for detecting surface defects in buildings based on image recognition includes the following steps: S1. Obtain a first set of images and a second set of images of the building surface taken from different perspectives within the same time period; S2. Generate several image groups, each image group including an image from a first image set and an image from a second image set, and the two images in the image group were captured at the same time; S3. Calculate the projection change relationship between two images in the image group, compare the two images in the image group based on the projection change relationship, and identify several candidate regions. S4. Convert the occurrence of the candidate region in multiple consecutive image groups into a description of the persistence of the candidate region in the time dimension. Based on the candidate regions, a stability judgment is made on the projection relationship to obtain a judgment result; S5. Based on the judgment result and the description of persistence, determine the category of the candidate region, the category including static defect category and dynamic shadow category; S6. Output the detection results of the candidate areas of the static defect category on the building surface.
[0006] As a further aspect of the present invention: obtaining the first image set and the second image set includes: A first image acquisition device and a second image acquisition device are arranged at a predetermined position. The optical axis direction of the first image acquisition device and the optical axis direction of the second image acquisition device are respectively a predetermined first angle and a predetermined second angle, and the first angle is not equal to the second angle. Simultaneously, the first image acquisition device and the second image acquisition device are controlled to periodically capture multiple images of the building surface, and the images acquired by the first image acquisition device and the second image acquisition device are arranged in chronological order to form the first image set and the second image set, respectively.
[0007] As a further aspect of the present invention: calculating the projection transformation relationship includes: Extract the first feature point set of the images in the first image set and the second feature point set of the images in the second image set; Establish a correspondence between the first set of feature points and the second set of feature points; Based on the correspondence of the feature points, a geometric transformation model is used to calculate the projection transformation matrix from the first image coordinate space to the second image coordinate space. The projection transformation matrix is the projection transformation relationship of the image group.
[0008] As a further aspect of the present invention: identifying candidate regions includes: Edge detection is performed on the images in the image group to obtain an edge image, and the edge pixels in the edge image constitute an edge pixel set; The edge pixel sets corresponding to the images in the first image set and the images in the second image set are respectively denoted as the first edge pixel set and the second edge pixel set; The interconnected edge pixels in the first edge pixel set and the second edge pixel set are respectively merged into the first edge line and the second edge line; Using the projection transformation relationship, the first edge line is mapped from the first image coordinate space to the second image coordinate space to obtain the corresponding projected edge line; In the second image coordinate space, calculate the distance between the projected edge line and the second edge line i, and calculate the angle difference between the direction of the projected edge line and the direction of the second edge line i, where the second edge line i represents any second edge line; When the distance is less than a preset distance threshold and the angle difference is less than a preset angle threshold, the region of the corresponding first edge line in the image is recorded as a candidate region.
[0009] As a further aspect of the present invention: obtaining the existence persistence description includes: The image in the first image set is denoted as the first image, and the candidate region k in the first image is taken as the target region, where the candidate region k represents any candidate region. Traverse the first image and count the ratio of the number of first images containing the target region to the total number of first images; During the traversal, count the number N of the first images that continuously exist in the target region, and record the time span corresponding to the number N. The ratio and the time span together constitute a description of the existence of continuity.
[0010] As a further aspect of the present invention: obtaining the judgment result includes: Multiple feature points are selected in the target area and recorded as verification points. Based on the projection transformation relationship, the verification points are transformed into secondary verification points. The images in the second image set are denoted as the second image. The positions of the verification points in the second image are obtained through feature matching and recorded as corresponding points. Calculate the coordinate distance between the secondary verification point and the corresponding point, calculate the mean and standard deviation of all coordinate distances, and record them as the verification difference and verification standard deviation. Select adjacent regions around the target region and calculate the verification difference and verification standard deviation of the adjacent regions; If the absolute difference between the verification difference of the adjacent region and the verification difference of the target region is greater than the preset first difference, or the absolute difference between the verification standard deviation of the adjacent region and the verification standard deviation of the target region is greater than the preset second difference, then the judgment result is poor projection relationship stability. Except as described above, the judgment result indicates that the projection relationship is stable.
[0011] As a further aspect of the present invention: determining the category of the candidate region includes: Preset frequency thresholds and time thresholds; If the ratio is less than the frequency threshold and the time span is less than the time threshold, then the corresponding candidate region category is the dynamic shadow category. If the ratio is greater than or equal to the frequency threshold and the time span is greater than or equal to the time threshold, or the ratio is less than the frequency threshold and the time span is greater than or equal to the time threshold, or the ratio is greater than or equal to the frequency threshold and the time span is less than the time threshold, then perform the following steps: If the judgment result is that the projection relationship is unstable, then the candidate region is determined to be a static defect category; If the judgment result indicates that the projection relationship is stable, then the candidate region is classified as a dynamic shadow category.
[0012] As a further aspect of the present invention: the output detection results include: The pixel locations of all candidate regions identified as static defect categories in the first image are merged. The positions of all merged pixels are transformed from the image coordinate system to the physical coordinate system associated with the building surface, resulting in the physical location coordinates of the static defect category candidate region on the building surface. Generate a list containing all physical location coordinates, and output the list as the detection result.
[0013] The beneficial effects of this invention compared to the prior art are as follows: This invention enables more reliable identification and classification of building surface defects in complex external environments, particularly suitable for application scenarios involving greenery obstruction and frequent changes in light and shadow around the exterior walls of high-rise buildings in older residential areas. By analyzing the temporal characteristics of candidate regions, this invention effectively eliminates interfering areas that are clearly transient and sporadic. Furthermore, for candidate regions that are difficult to distinguish based solely on temporal characteristics, it further assesses them from a spatial consistency perspective, allowing for a more accurate characterization of whether the candidate regions originate from changes in the actual structural structure of the building surface. This judgment mechanism reflects the degree to which candidate regions influence the overall geometric continuity of the building surface, thus clearly distinguishing between actual defects and interfering areas that only alter appearance features. By combining temporal characteristics with spatial stability, this invention makes the classification results of candidate regions more consistent with the objective state of the building surface, reducing misjudgments caused by environmental factors such as changes in lighting and greenery projection. Simultaneously, this invention can accurately map areas identified as static defects to their actual locations on the building surface, providing a reliable basis for subsequent maintenance, evaluation, and management, and overall improving the applicability and reliability of building surface defect detection in practical engineering scenarios. Attached Figure Description
[0014] The invention will now be further described with reference to the accompanying drawings.
[0015] Figure 1 This is a flowchart illustrating a method for detecting surface defects in buildings based on image recognition, according to the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] Please see Figure 1As shown, this invention is a method for detecting surface defects in buildings based on image recognition, comprising the following steps: S1. Obtain a first set of images and a second set of images of the building surface taken from different perspectives within the same time period; In a preferred embodiment of the present invention, obtaining a first image set and a second image set includes: A first image acquisition device and a second image acquisition device are arranged at a predetermined position. The optical axis direction of the first image acquisition device and the optical axis direction of the second image acquisition device are respectively a predetermined first angle and a predetermined second angle, and the first angle is not equal to the second angle. Simultaneously, the first image acquisition device and the second image acquisition device are controlled to periodically capture multiple images of the building surface, and the images acquired by the first image acquisition device and the second image acquisition device are arranged in chronological order to form the first image set and the second image set, respectively.
[0018] S2. Generate several image groups, each image group including an image from a first image set and an image from a second image set, and the two images in the image group were captured at the same time; S3. Calculate the projection change relationship between two images in the image group, compare the two images in the image group based on the projection change relationship, and identify several candidate regions. In another preferred embodiment of the present invention, calculating the projection variation relationship includes: Before calculating the projection transformation relationship, the two images in the image group are taken at the same time, and the two images are prepared in a unified manner to ensure the comparability of feature extraction. The texture and edge information are stabilized by denoising and contrast adjustment of the images, while keeping the geometric structure of the two images unchanged.
[0019] When obtaining the first set of feature points on the target image in the first image set, the pixel positions with significant two-dimensional structures are searched in the image based on local gray-level changes and corner stability. A fixed-size neighborhood is formed around each candidate position, and the gray-level distribution and orientation changes within the neighborhood are encoded to obtain a descriptor. The descriptor and the pixel coordinates of the feature point together constitute the first set of feature points. The second set of feature points is obtained in the same way on the corresponding image in the second image set, thereby ensuring that the two sets of feature points remain compatible under scale and rotation changes.
[0020] When establishing the correspondence between feature points, the descriptors in the first feature point set and the descriptors in the second feature point set are similar to each other. The nearest neighbor matching is used to find candidate corresponding points for each first feature point. Unreliable matches are eliminated by using similarity differences to reduce the geometric deviation caused by mismatches. Then, the spatial distribution of feature points is combined to perform consistency screening of the matching results so that the remaining correspondences can be interpreted by the same type of transformation in the overall geometry.
[0021] When calculating the projection transformation matrix from the first image coordinate space to the second image coordinate space using a geometric transformation model based on the filtered feature point correspondences, each pair of corresponding points is regarded as a constraint condition. The constraint condition describes that the feature points in the first image should fall near the corresponding feature points in the second image after projection. The influence of outliers is suppressed by repeatedly extracting a small number of point pairs from the correspondences to construct candidate models and verifying their interpretability for the remaining point pairs. In each verification, the feature point positions in the first image are mapped to the second image coordinate space according to the candidate model. The deviation between the mapping result and the actual corresponding point positions is compared, and the set of consistent points is determined accordingly. After the size of the set of consistent points reaches stability, the corresponding candidate model is selected as the initial result. After obtaining the initial results, the model parameters are further refined using the set of consistent points to make the projection mapping more consistent with the geometric constraints of all consistent points. During the refinement process, the first and second image coordinates in the set of consistent points are input. The processing involves adjusting the transformation parameters under the constraints of the geometric transformation model to reduce the overall mapping deviation of the consistent points. The output is the final projection transformation matrix, which is used to characterize the projection transformation relationship of the image group from the first image coordinate space to the second image coordinate space and serves as the basis for subsequent comparison and identification of candidate regions.
[0022] In a preferred embodiment, identifying candidate regions includes: Before entering the candidate region recognition, the two images in the image group are captured at the same time and undergo necessary preprocessing under the same processing link to reduce the interference of noise on the edge response. The influence of random texture and compressed noise on the gradient is suppressed by smoothing filtering, while maintaining the continuity of fine line structures such as wall cracks without being significantly weakened. On this basis, edge detection is performed on the image to obtain the edge image.
[0023] In the edge detection process, the gradient intensity and gradient direction of each pixel neighborhood are calculated based on the grayscale changes in the image. Then, the gradient response is refined into a single-pixel-wide edge through non-maximum suppression. Combined with threshold determination, stable edge responses are retained as edge pixels. All pixels in the edge image that are determined to be edges together constitute the edge pixel set. The edge pixel set obtained from the target image in the first image set is denoted as the first edge pixel set, and the edge pixel set obtained from the corresponding image in the second image set is denoted as the second edge pixel set.
[0024] To recover a linear structure that can be used for geometric alignment comparison from discrete edge pixels, interconnected edge pixels in the first edge pixel set are aggregated based on pixel connectivity. Pixel sequences that are located in the same connected domain and are continuous in the local direction are merged into the first edge line. During the merging process, the edge direction is iteratively tracked along the neighborhood of the edge pixel, and different directions at the bifurcation point are split into different edge lines to avoid mixing two different structures. The same connectivity merging method is used in the second edge pixel set to obtain the second edge line set, and any one of the second edge lines is denoted as the second edge line i.
[0025] When using the obtained projection transformation relationship, the pixel coordinates on the first edge line are taken as input, and these coordinates are mapped to the second image coordinate space through projection transformation. The point set obtained after mapping is connected in the original order to form the projection edge line. In order to avoid the discrete error generated after mapping from affecting the stability of distance and direction, the projection edge line is resampled to keep a uniform sampling interval along the length direction, and the local tangential direction is estimated on the resampled point sequence to characterize the overall direction of the projection edge line.
[0026] When entering the matching determination, the point sequence of the second edge line i is obtained in the second image coordinate space, and a spatial index or distance field for distance calculation is established for the second edge line i, so that the nearest distance from any sampling point of the projected edge line to the second edge line i can be quickly obtained. The distance is obtained with the sampling points of the projected edge line as input. The processing is to find the nearest point in the point sequence of the second edge line i or its line segment fitting representation and obtain the minimum distance from the point to the line. The output is the overall distance metric between the projected edge line and the second edge line i. This metric can be characterized by the statistical results of the nearest distance from each sampling point of the projected edge line to the second edge line i and used for comparison with the preset distance threshold.
[0027] The direction and angle difference is obtained by taking the tangential direction of the projected edge line and the tangential direction of the second edge line i as input. The local direction is obtained by the difference between adjacent points on the point sequence of the two edge lines and smoothed to reduce the direction jitter caused by jagged noise. Then, the overall main direction is obtained from the local direction. After that, the difference between the main directions is calculated in the same angle representation domain and the angle difference is obtained. The output is the direction difference metric between the projected edge line and the second edge line i and is used to compare with the preset angle threshold.
[0028] When the distance between the projected edge line and a certain second edge line i is less than a preset distance threshold and the angle difference is less than a preset angle threshold, it is considered that the first edge line has a consistent geometric correspondence in both viewpoints. The coverage area of the first edge line in the first image is determined as a candidate region. In order to make the candidate region have a clear pixel range, the first edge line pixels are used as a skeleton and extended to both sides in the normal direction to obtain a strip-shaped region. At the same time, the continuity of the region is maintained by combining the edge line length and connectivity. Thus, the region of the corresponding first edge line in the image is recorded as a candidate region for subsequent persistence analysis.
[0029] S4. Convert the occurrence of the candidate region in multiple consecutive image groups into a description of the persistence of the candidate region in the time dimension. In another preferred embodiment of the present invention, obtaining the existence persistence description includes: The image in the first image set is denoted as the first image, and the candidate region k in the first image is taken as the target region, where the candidate region k represents any candidate region. Traverse the first image and count the ratio of the number of first images containing the target region to the total number of first images; During the traversal, count the number N of the first images that continuously exist in the target region, and record the time span corresponding to the number N. The ratio and the time span together constitute a description of the existence of continuity.
[0030] Based on the candidate regions, a stability judgment is made on the projection relationship to obtain a judgment result; In another preferred embodiment of the present invention, obtaining the judgment result includes: After obtaining the first and second images at the same time and establishing their projection transformation relationship, the pixel range of the candidate region is used as a constraint in the target region. Multiple feature points are selected as verification points based on the points in the region with obvious gray-scale changes and repeatable local textures. To ensure the stability of subsequent matching, the selection of verification points avoids falling on large flat or single-color areas and forms a distribution in the target region so that it can cover the main structural boundaries of the target region.
[0031] Based on the projection transformation relationship, each verification point within the target area is transformed in coordinates to obtain corresponding secondary verification points. These secondary verification points represent the positions of the verification points in the second image coordinate space calculated from the projection transformation relationship. The corresponding points of the verification points in the second image are obtained through feature matching. The descriptive information of the verification points in the first image is used as the query, and the neighborhood range of the target area mapped by the projection transformation relationship in the second image is used as the search constraint. Within this search range, the closest feature point is matched, and its pixel coordinates are marked as the corresponding point. If a verification point cannot be reliably matched within the search range, it is not included in subsequent statistics.
[0032] The coordinate distance between the secondary verification point and the corresponding point is used to reflect the degree of deviation between the projected position and the actual matching position. The coordinate distances of all valid verification points are statistically analyzed to obtain the central tendency and dispersion of the distance set, which are recorded as the verification difference and verification standard deviation, respectively. The verification difference is used to characterize the overall deviation level, and the verification standard deviation is used to characterize the consistency of the deviation distribution.
[0033] The adjacent regions surrounding the target region are defined as pixel regions that are adjacent to but do not overlap with the target region. These regions are spatially aligned with the target region's boundary and lie within the same image plane. Within these adjacent regions, verification points are selected in the same manner as for the target region, and the same projection transformation, feature matching, and statistical processes are performed to obtain the verification difference and standard deviation of the adjacent regions. The verification difference between the target region and the adjacent regions is compared, and their absolute differences are taken. Simultaneously, their standard deviations are compared, and their absolute differences are taken. If either absolute difference exceeds a preset threshold, it indicates that the target region exhibits different projection consistency characteristics relative to its surrounding regions, and the result is recorded as poor projection relationship stability. If the above conditions are not met, it indicates that the target region and its surrounding regions maintain similar characteristics in terms of projection consistency, and the result is recorded as good projection relationship stability.
[0034] It is important to note that genuine defects on building surfaces originate from changes in wall materials or structural conditions. Once formed, these changes are permanently embedded in the building structure and participate in the spatial mapping process from different perspectives, affecting the consistency of projection in local areas. This causes the affected area to exhibit discontinuous or abnormal geometric mapping characteristics relative to its surrounding intact areas. In contrast, shadows created by factors such as changes in lighting and vegetation occupancy are merely apparent changes in the imaging process. They do not alter the actual spatial structure of the building surface and remain attached to the original wall geometry for imaging from different perspectives. Therefore, they do not disrupt the consistency of local space in projection relationships. By analyzing the deviation characteristics after projection mapping within the target area and its adjacent areas, these geometric differences can be amplified and identified, allowing for an objective characterization of whether candidate areas originate from real structural changes. This approach avoids the uncertainties arising from relying solely on appearance similarity or temporal repetition, returning the judgment criteria to the stable spatial properties of the building surface. This helps eliminate non-structural interference under complex lighting and occupancy conditions, resulting in detection results that better reflect the true state of the building and providing a more reliable basis for defect identification.
[0035] S5. Determine the category of the candidate region based on the existence persistence description, the category including static defect category and dynamic shadow category; In a preferred embodiment of the present invention, determining the category of the candidate region includes: Preset frequency thresholds and time thresholds; If the ratio is less than the frequency threshold and the time span is less than the time threshold, then the corresponding candidate region category is the dynamic shadow category. If the ratio is greater than or equal to the frequency threshold and the time span is greater than or equal to the time threshold, or the ratio is less than the frequency threshold and the time span is greater than or equal to the time threshold, or the ratio is greater than or equal to the frequency threshold and the time span is less than the time threshold, then perform the following steps: If the judgment result is that the projection relationship is unstable, then the candidate region is determined to be a static defect category; If the judgment result indicates that the projection relationship is stable, then the candidate region is classified as a dynamic shadow category.
[0036] Understandably, in real-world scenarios, especially in older residential buildings with high-rise exterior walls and abundant surrounding greenery, relying solely on the frequency and duration of candidate areas over time can easily misclassify persistent or recurring visual disturbances such as shadows and occlusions as genuine defects. Therefore, a projection relationship stability assessment is introduced. This involves analyzing whether candidate areas cause local spatial anomalies or discontinuities in projection changes across different viewpoints, geometrically characterizing whether the area originates from genuine structural changes on the building surface. Genuine defects such as cracks and bulges disrupt the original geometric consistency of the wall, resulting in poor projection relationship stability. Shadows cast by lighting or vegetation, however, only alter the apparent features of the image and do not cause substantial instability in the projection relationship. Therefore, while retaining the original temporal persistence assessment as a preliminary screening method, the final classification is determined by the projection relationship stability result. This ensures that candidate areas are only subject to geometric consistency constraints if temporal characteristics are not significantly excluded. This effectively reduces the false detection rate caused by shadow-related interference without increasing the perceived hardware, improving the reliability and engineering applicability of building surface defect detection results.
[0037] S6. Output the detection results of the candidate areas of the static defect category on the building surface.
[0038] In another preferred embodiment of the present invention, the output detection results include: The pixel locations of all candidate regions identified as static defect categories in the first image are merged. The positions of all merged pixels are transformed from the image coordinate system to the physical coordinate system associated with the building surface, resulting in the physical location coordinates of the static defect category candidate region on the building surface. Generate a list containing all physical location coordinates, and output the list as the detection result.
[0039] Understandably, this invention transforms the identification process of building surface defects from the traditional method relying on single-viewpoint, single-moment image appearance features to a mechanism simultaneously constrained by geometric consistency and temporal stability, fundamentally altering the distinction between exterior wall defects and environmental interference. By introducing the projection correspondence between images at the same moment under different fixed viewpoints, candidate targets must form a stable three-dimensional geometric mapping in physical space. Only linear structures truly existing on the building surface can maintain predictable and corresponding projection relationships after viewpoint changes, thus excluding a large amount of shadow interference dependent on lighting conditions at the geometric level. Furthermore, it does not stop at a single judgment of geometric consistency but further places the geometrically constrained candidate targets in the temporal dimension for continuous verification. Candidate targets must exhibit stable existence characteristics consistent with the building structure in a continuous temporal sequence to be ultimately identified as defects. The combination of geometric locking and temporal confirmation enables this invention not only to eliminate unstable shadow interference that changes with viewpoint but also to isolate dynamic shadows with accidental consistency in short periods under complex environments, thereby achieving reliable identification of true static defects. This holistic discrimination approach, which organically combines spatial geometric consistency with temporal stability, enables the present invention to possess anti-interference capabilities and discrimination reliability that are difficult to achieve with existing image recognition-based methods in complex exterior wall inspection scenarios characterized by greenery and frequent changes in light and shadow.
[0040] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the present invention should still fall within the scope of the present invention.
Claims
1. A method for detecting surface defects in buildings based on image recognition, characterized in that, Includes the following steps: S1. Obtain a first set of images and a second set of images of the building surface taken from different perspectives within the same time period; S2. Generate several image groups, each image group including an image from a first image set and an image from a second image set, and the two images in the image group were captured at the same time; S3. Calculate the projection change relationship between two images in the image group, compare the two images in the image group based on the projection change relationship, and identify several candidate regions. S4. Convert the occurrence of the candidate region in multiple consecutive image groups into a description of the persistence of the candidate region in the time dimension. Based on the candidate regions, the stability of the projection relationship is determined to obtain the judgment result; S5. Based on the judgment result and the description of persistence, determine the category of the candidate region, the category including static defect category and dynamic shadow category; S6. Output the detection results of the candidate areas of static defect categories on the building surface. Candidate regions to be identified include: Edge detection is performed on the images in the image group to obtain an edge image, and the edge pixels in the edge image constitute an edge pixel set; The edge pixel sets corresponding to the images in the first image set and the images in the second image set are respectively denoted as the first edge pixel set and the second edge pixel set; The interconnected edge pixels in the first edge pixel set and the second edge pixel set are respectively merged into the first edge line and the second edge line; Using the projection transformation relationship, the first edge line is mapped from the first image coordinate space to the second image coordinate space to obtain the corresponding projected edge line; In the second image coordinate space, calculate the distance between the projected edge line and the second edge line i, and calculate the angle difference between the direction of the projected edge line and the direction of the second edge line i, where the second edge line i represents any second edge line; When the distance is less than a preset distance threshold and the angle difference is less than a preset angle threshold, the region of the corresponding first edge line in the image is recorded as a candidate region.
2. The method for detecting surface defects in buildings based on image recognition according to claim 1, characterized in that, Obtaining the first image set and the second image set includes: A first image acquisition device and a second image acquisition device are arranged at a predetermined position. The optical axis direction of the first image acquisition device and the optical axis direction of the second image acquisition device are respectively a predetermined first angle and a predetermined second angle, and the first angle is not equal to the second angle. Simultaneously, the first image acquisition device and the second image acquisition device are controlled to periodically capture multiple images of the building surface, and the images acquired by the first image acquisition device and the second image acquisition device are arranged in chronological order to form the first image set and the second image set, respectively.
3. The method for detecting surface defects in buildings based on image recognition according to claim 1, characterized in that, Calculating the projection variation relationship includes: Extract the first feature point set of the images in the first image set and the second feature point set of the images in the second image set; Establish a correspondence between the first set of feature points and the second set of feature points; Based on the correspondence of the feature points, a geometric transformation model is used to calculate the projection transformation matrix from the first image coordinate space to the second image coordinate space. The projection transformation matrix is the projection transformation relationship of the image group.
4. The method for detecting surface defects in buildings based on image recognition according to claim 1, characterized in that, Obtaining a persistent description includes: The image in the first image set is denoted as the first image, and the candidate region k in the first image is taken as the target region, where the candidate region k represents any candidate region. Traverse the first image and count the ratio of the number of first images containing the target region to the total number of first images; During the traversal, count the number N of the first images that continuously exist in the target region, and record the time span corresponding to the number N. The ratio and the time span together constitute a description of the existence of continuity.
5. The method for detecting surface defects in buildings based on image recognition according to claim 4, characterized in that, The results of the judgment include: Multiple feature points are selected in the target area and recorded as verification points. Based on the projection transformation relationship, the verification points are transformed into secondary verification points. The images in the second image set are denoted as the second image. The positions of the verification points in the second image are obtained through feature matching and recorded as corresponding points. Calculate the coordinate distance between the secondary verification point and the corresponding point, calculate the mean and standard deviation of all coordinate distances, and record them as the verification difference and verification standard deviation. Select adjacent regions around the target region and calculate the verification difference and verification standard deviation of the adjacent regions; If the absolute difference between the verification difference of the adjacent region and the verification difference of the target region is greater than the preset first difference, or the absolute difference between the verification standard deviation of the adjacent region and the verification standard deviation of the target region is greater than the preset second difference, then the judgment result is poor projection relationship stability. Except as described above, the judgment result indicates that the projection relationship is stable.
6. The method for detecting surface defects in buildings based on image recognition according to claim 5, characterized in that, The categories for determining candidate regions include: Preset frequency thresholds and time thresholds; If the ratio is less than the frequency threshold and the time span is less than the time threshold, then the corresponding candidate region category is the dynamic shadow category. If the ratio is greater than or equal to the frequency threshold and the time span is greater than or equal to the time threshold, or the ratio is less than the frequency threshold and the time span is greater than or equal to the time threshold, or the ratio is greater than or equal to the frequency threshold and the time span is less than the time threshold, then perform the following steps: If the judgment result is that the projection relationship is unstable, then the candidate region is determined to be a static defect category; If the judgment result indicates that the projection relationship is stable, then the candidate region is classified as a dynamic shadow category.
7. The method for detecting surface defects in buildings based on image recognition according to claim 6, characterized in that, The output detection results include: The pixel locations of all candidate regions identified as static defect categories in the first image are merged. The positions of all merged pixels are transformed from the image coordinate system to the physical coordinate system associated with the building surface, resulting in the physical location coordinates of the static defect category candidate region on the building surface. Generate a list containing all physical location coordinates, and output the list as the detection result.
Citation Information
Patent Citations
Detection and validation of objects from sequential images from camera by means of homographs
CN109791607A