A visual-based garbage can surface crack detection method and system
By combining target detection models and color gradient algorithms, the problem of distinguishing between real cracks and interference noise in the detection of surface cracks in trash cans has been solved, achieving efficient and accurate crack recognition, adapting to complex environments, and meeting the needs of smart city management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG PROPHET BIG DATA CO LTD
- Filing Date
- 2026-02-25
- Publication Date
- 2026-06-05
AI Technical Summary
Existing image processing-based methods for detecting surface cracks in trash cans struggle to effectively distinguish between real cracks and temporary interference noise in complex environments, leading to a high false detection rate and impacting the practicality and reliability of the detection.
The trash can image was segmented using an object detection model. Edge features were extracted by combining Gaussian filtering for noise reduction and color gradient algorithm. Suspected crack areas were screened by clustering color change points and geometric features. The actual crack areas were confirmed by spatiotemporal matching.
Accurately identify real cracks on the surface of trash cans in complex environments, significantly reduce false detection rates, and meet the needs of intelligent management of sanitation facilities in smart cities.
Smart Images

Figure CN122156107A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of facility and equipment management technology, and in particular relates to a vision-based method and system for detecting surface cracks in trash cans. Background Technology
[0002] As an integral part of urban infrastructure, trash cans are constantly exposed to the outdoor environment, suffering from sun and rain, mechanical impacts, and chemical corrosion, making their surfaces prone to cracking and damage. These cracks not only affect the lifespan and aesthetics of the trash cans but can also lead to safety hazards such as garbage leakage and bacterial growth. With the advancement of smart city construction, intelligent management of sanitation facilities has become an important direction for urban management, and automated detection of surface cracks in trash cans is one of the key technologies for achieving intelligent management of sanitation facilities. Traditional manual inspection methods suffer from low efficiency, high cost, and difficulty in achieving large-scale real-time monitoring; therefore, there is an urgent need to adopt automated detection technology based on computer vision to replace manual inspection.
[0003] Existing image processing-based defect detection technologies face challenges when applied to detecting cracks on trash can surfaces. These surface interferences, such as stains, watermarks, and reflections, present visual characteristics similar to real cracks in static images, including edge gradient changes and color abrupt shifts. This makes it difficult for existing detection methods to effectively distinguish between real cracks and temporary noise, resulting in a high false detection rate. In particular, temporary features like stains and watermarks may appear as narrow, elongated shapes and edge features resembling cracks in a single image frame. This makes detection methods relying solely on single-image analysis unable to accurately determine the authenticity of the target, severely impacting the practicality and reliability of trash can crack detection. Summary of the Invention
[0004] In view of the shortcomings of the prior art, the purpose of the invention is to provide a vision-based method and system for detecting surface cracks in trash cans.
[0005] This invention provides a vision-based method for detecting surface cracks in trash cans, comprising: S1. The trash can image is segmented using a target detection model to obtain the trash can region and target coordinates; S2. Extract edge features from pixels within the trash can area using a color gradient algorithm to obtain a set of color abrupt change points; S3. Cluster the set of color mutation points according to the continuity criterion to obtain multiple color mutation clusters, and select suspected crack areas based on geometric features. S4. Perform spatiotemporal matching verification on images of multiple consecutive suspected crack areas, and determine the suspected crack area that meets the positional stability condition as the real crack area.
[0006] According to the vision-based method for detecting surface cracks in a trash can provided by the present invention, step S1 further includes: S11. Capture images of the trash can; S12. The trash can image is smoothed by Gaussian filtering to obtain noise-reduced image data; S13. Input the denoised image data into the MaskR-CNN model to obtain the coordinates of the target box where the trash can is located, the trash can area within the target box, and the RGB coordinates of the pixels.
[0007] According to the vision-based method for detecting surface cracks in a trash can provided by the present invention, step S2 further includes: S21. Calculate the gradient value of each pixel in the trash can area across multiple color channels; S22. Merge the gradient values of multiple color channels and calculate the comprehensive color features of the corresponding pixel. S23. Pixels whose comprehensive color features are greater than or equal to the first preset threshold are identified as color mutation points, and a set of color mutation points is obtained.
[0008] According to the vision-based method for detecting surface cracks in a trash can provided by the present invention, step S3 further includes: S31. Select any color mutation point in the set of color mutation points as the initial point, add color mutation points whose pixel distance from the initial point is less than a preset parameter to the same cluster, and continuously optimize the neighboring points of the newly added points until all the neighboring points of all points in the current cluster are in the cluster, thus obtaining multiple color mutation clusters. S32. For a single color mutation cluster, calculate the parameters of the bounding rectangle; S33. Identify the internal pixels surrounded by the color mutation cluster within the outer rectangle of the color mutation cluster, and form a set of shadow points together with the internal pixels and the corresponding color mutation cluster. Count the number of points in the set of shadow points. S34. When the area ratio of the set of shadow points is greater than the second preset threshold and less than the third preset threshold, calculate the geometric features of the set of shadow points, including aspect ratio, extension and compactness. S35. Based on the geometric features and the first preset conditions, a suspected crack area is selected and the relative rectangular coordinates of the suspected crack area are recorded.
[0009] According to the vision-based method for detecting surface cracks in a trash can provided by the present invention, the expression for the first preset condition in step S35 is: in, Aspect ratio, For extension, For compactness.
[0010] According to the vision-based method for detecting surface cracks in a trash can provided by the present invention, step S4 further includes: S41. Collect multiple images of trash cans continuously and obtain the corresponding suspected crack areas for each; S42. For any suspected crack region in an image, search for a corresponding region that satisfies the positional stability condition in the suspected crack regions of subsequent images. S43. Determine whether there are multiple images where the suspected crack area meets the second preset condition. When all of them meet the second preset condition, the current suspected crack area that meets the positional stability condition is determined as the real crack area.
[0011] According to the vision-based method for detecting surface cracks in trash cans provided by the present invention, multiple trash can images are collected in step S41 on a daily basis, and the expression for the second preset condition in step S43 is: in, Indicates the time index value. Let x be the x-coordinate of the left vertex of the suspected crack region on day t. Let y be the left vertex coordinate of the suspected crack region on day t. The width of the suspected crack area on day t. The height of the suspected crack area on day t; Let x be the x-coordinate of the left vertex of the suspected crack region on day t+1. Let y be the left vertex coordinate of the suspected crack region on day t+1. The width of the suspected crack area on day t+1. The height of the suspected crack area on day t+1; Let x be the x-coordinate of the left vertex of the suspected crack region on day t+2. Let y be the left vertex coordinate of the suspected crack area on day t+2. The width of the suspected crack area on day t+2. The high value of the suspected crack area on day t+2.
[0012] A second aspect of the present invention provides a vision-based system for detecting surface cracks in trash cans, comprising: Segmentation module: Used to segment trash can images using an object detection model to obtain the trash can region and object coordinates; Extraction module: used to extract edge features of pixels in the trash can area using a color gradient algorithm to obtain a set of color abrupt change points; Screening module: used to cluster the set of color mutation points according to the continuity criterion to obtain multiple color mutation clusters, and to screen suspected crack areas based on geometric features; Identification module: used to perform spatiotemporal matching verification on images of multiple consecutive suspected crack areas, and to determine the suspected crack area that meets the positional stability condition as the real crack area.
[0013] A third aspect of the present invention provides a vision-based device for detecting surface cracks in trash cans, comprising: A memory and at least one processor, wherein the memory stores instructions; At least one of the processors invokes the instructions in the memory to cause a vision-based trash can surface crack detection device to perform a vision-based trash can surface crack detection method as described in any of the preceding claims.
[0014] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed by a processor, implement a vision-based method for detecting surface cracks in a trash can as described in any of the preceding claims.
[0015] This invention provides a vision-based method, system, device, and storage medium for detecting surface cracks in trash cans. First, it segments the trash can image using a target detection model and combines this with Gaussian filtering for noise reduction. This accurately locates the trash can area in complex environments while preserving key edge information, laying a solid foundation for subsequent crack feature extraction. Second, it calculates the gradient values in the x and y directions of pixels within the trash can area using a color gradient algorithm across three color channels. By fusing these gradients, a comprehensive color feature is obtained, accurately capturing color abrupt change areas on the trash can surface and effectively identifying potential crack boundary points. Compared to traditional single-channel edge detection methods, this method offers higher feature representation and anti-interference capabilities. Third, based on a continuity criterion, this invention clusters color abrupt change points and calculates the circumscribed rectangle parameters. This invention identifies a set of shadow points formed by surrounded pixels and filters them based on geometric features such as aspect ratio, extension, and compactness. It accurately characterizes typical features of cracks from a morphological perspective, such as their elongation, extension, and irregularity, effectively filtering out interference areas whose morphological features do not conform to crack characteristics, significantly reducing the false detection rate. Furthermore, by continuously collecting suspected crack areas over multiple days and performing spatiotemporal matching verification, this invention utilizes the temporal characteristics of real cracks remaining stable in relative position on the trash can surface while temporary interference such as stains and water stains change position or disappear. This allows for effective differentiation between real cracks and temporary interference noise from a temporal dimension, fundamentally solving the technical challenge of distinguishing similar visual features in static image analysis. This makes the detection results more reliable and accurate, meeting the practical needs of intelligent management of sanitation facilities in smart city construction. Attached Figure Description
[0016] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. It is obvious that the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings.
[0017] Figure 1 A schematic diagram of a vision-based method for detecting surface cracks in a trash can, provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a vision-based trash can surface crack detection system provided in an embodiment of the present invention. Detailed Implementation
[0018] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.
[0019] Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts disclosed in this invention.
[0020] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. The terms "installed," "connected," and "linked" should be interpreted broadly; for example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0021] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of methods and systems consistent with some aspects of the invention as detailed in the appended claims.
[0022] like Figure 1 As shown, the present invention provides a vision-based method for detecting surface cracks in trash cans, comprising: S1. The trash can image is segmented using a target detection model to obtain the trash can region and target coordinates.
[0023] Step S1 further includes: S11. Collect images of the trash can.
[0024] In step S11, after inputting the trash can image into the Mask R-CNN model, the model outputs the coordinates (x, y, w, h) of the bounding box containing the trash can, where (x, y) represents the horizontal and vertical coordinates of the top-left corner of the bounding box in the image coordinate system, w represents the width of the bounding box in pixels, and h represents the height of the bounding box in pixels. Simultaneously, the model outputs the trash can area within the bounding box. Let be a set of pixels, where each element (i,j) represents the coordinates of a pixel on the surface of the trash can.
[0025] S12. The trash can image is smoothed by Gaussian filtering to obtain noise-reduced image data.
[0026] In step S12, this invention aims to apply Gaussian filtering to the trash can image for smoothing. The Gaussian filtering uses a two-dimensional Gaussian function as the convolution kernel to perform convolution operations on the image. Specifically, this invention calculates weights according to the Gaussian function within the neighborhood of each pixel, with the weights decreasing exponentially with increasing distance from the center point. Subsequently, this invention multiplies the values of each pixel in the neighborhood by their corresponding weights and sums the results to obtain the new value of the center pixel, completing the noise reduction process and outputting the noise-reduced image data.
[0027] S13. Input the denoised image data into the MaskR-CNN model to obtain the coordinates of the target box where the trash can is located, the trash can area within the target box, and the RGB coordinates of the pixels.
[0028] Furthermore, this invention iterates through all pixels in the denoised image and extracts the red channel value at coordinates (i,j) of each pixel. Green channel value and blue channel value The values for all three channels range from 0 to 255. Finally, this invention stores the RGB color coordinates of all pixels as a three-dimensional array, which serves as input data for subsequent color gradient calculations.
[0029] S2. Edge features are extracted from the pixels within the trash can area using a color gradient algorithm to obtain a set of color abrupt change points.
[0030] Step S2 further includes: S21. Calculate the gradient value of each pixel in the trash can area across multiple color channels.
[0031] Furthermore, in step S21, each pixel is obtained. The boundary value feature for each color channel is expressed as follows: in, For pixels The gradient value in the x-direction on the red channel. Coordinates are The pixel-based trash can region criterion score, Coordinates are The red channel value of the pixel, For pixels The gradient value in the y-direction on the red channel. For pixels The combined gradient value on the red channel.
[0032] in, For pixels The gradient value in the x-direction on the green channel. Coordinates are The green channel value of the pixel. For pixels The gradient value in the y-direction on the green channel. For pixels The overall gradient value on the green channel.
[0033] in, For pixels The gradient value in the x-direction on the blue channel. Coordinates are The blue channel value of the pixel. For pixels The gradient value in the y-direction on the blue channel. For pixels The combined gradient value on the blue channel.
[0034] in The score for the trash can area is expressed as follows: in, Output the trash can area within the box for the model.
[0035] S22. Merge the gradient values of multiple color channels to calculate the comprehensive color features of the corresponding pixel.
[0036] In step S22, the present invention calculates the color features of the pixel, expressed as: in, It represents the comprehensive color features of a pixel.
[0037] S23. Pixels whose comprehensive color features are greater than or equal to the first preset threshold are identified as color mutation points, and a set of color mutation points is obtained.
[0038] Furthermore, in step S23, the present invention determines whether there is a color abrupt change in a pixel based on color features, and when the condition is met... and When a pixel is determined to be a color abrupt change point, then... The first judgment threshold is set, representing the minimum value of color features required for color variation points, which is calculated by collecting crack images to determine the minimum value of color features at crack boundary points.
[0039] S3. Cluster the set of color mutation points according to the continuity criterion to obtain multiple color mutation clusters, and select suspected crack areas based on geometric features.
[0040] Step S3 further includes: S31. Select any color mutation point in the set of color mutation points as the initial point, add color mutation points whose pixel distance from the initial point is less than a preset parameter to the same cluster, and continuously optimize the neighboring points of the newly added points until all the neighboring points of all points in the current cluster are in the cluster, thus obtaining multiple color mutation clusters.
[0041] Furthermore, in step S31, the present invention groups the color abrupt change points in the image into a set. Where k is the index of the color abrupt change point. Let x be the x-coordinate of the k-th color abrupt change point. Let y be the ordinate of the k-th color abrupt change point. Subsequently, based on continuity, these color abrupt change points are clustered into different clusters. The specific method is as follows: Set as the first cluster To include sets that are not in clusters And satisfying ( The pixel distance is less than All points are added to the cluster. Then for clusters For each pixel, add its neighboring pixels to the cluster using the method described above. until cluster The nearest points of each point are in the cluster. In the middle; then the cluster Remove the points from the set, select one pixel from the remaining set, and repeat the above method to obtain the second cluster. Repeat the above operation until all points are assigned to clusters.
[0042] S32. For a single color mutation cluster, calculate the parameters of the circumscribed rectangle.
[0043] In step S32, the present invention applies to any cluster Obtain the circumscribed rectangle information of this cluster. The specific expression is: in, This represents the index of the color abrupt change point in the cluster. This represents the total number of points in the color mutation cluster. Let x be the x-coordinate of the m-th point in the color mutation cluster. Let be the ordinate of the m-th point in the color mutation cluster. Let x be the x-coordinate of the left boundary of the bounding rectangle of the color mutation cluster. Let be the ordinate of the upper boundary of the bounding rectangle of the color mutation cluster. The width of the bounding rectangle of the color mutation cluster. The height of the bounding rectangle of the color mutation cluster.
[0044] S33. Identify the internal pixels surrounded by the color mutation cluster within the outer rectangle of the color mutation cluster, and form a set of shadow points together with the corresponding color mutation cluster. Count the number of points in the set of shadow points.
[0045] In step S33, the present invention traverses all pixels within the bounding rectangle. For each pixel that does not belong to a color mutation cluster, this invention determines whether there exists a point in the cluster. satisfy and Does a point exist in the cluster? satisfy and Does a point exist in the cluster? satisfy and Does a point exist in the cluster? satisfy and When a pixel has color abrupt changes in clusters in all four directions, it is determined to be an internal pixel. Ultimately, this invention combines all internal pixels that satisfy the spatial enclosure condition with points in the color abrupt change clusters to form a set of shadow points. Where p is the index of the shaded point, and the total number of points in the set of shaded points is counted. ,in Let x be the x-coordinate of the p-th shaded point. Let be the ordinate of the p-th shaded point.
[0046] S34. When the area ratio of the set of shadow points is greater than the second preset threshold and less than the third preset threshold, calculate the geometric features of the set of shadow points, including aspect ratio, extension and compactness.
[0047] Furthermore, when At that time, among them The second threshold is determined by multiplying the minimum ratio of the crack area to the area within the trash can frame in the collected crack images by 0.9. The third judgment threshold is determined by multiplying the maximum ratio of the crack area to the trash can frame in the collected crack images by 1.1. The following geometric features are then calculated, expressed as follows: Among them, aspect ratio The expression is: Extensibility The expression is: Compactness S35. Based on the geometric features and the first preset conditions, a suspected crack area is selected and the relative rectangular coordinates of the suspected crack area are recorded.
[0048] The expression for the first preset condition in step S35 is: in, Aspect ratio, For extension, For compactness.
[0049] Furthermore, when the geometric features respectively satisfy , , When determining that the shaded area corresponding to the cluster is a suspected crack area, the relative rectangular area of the shadow is also recorded. The expression is: in, Indicates the date. Let x be the relative x-coordinate of the suspected crack area on day t. Let be the relative ordinate of the suspected crack area on day t. Let be the relative width of the suspected crack area on day t. Let be the relative height of the suspected crack area on day t. Finally, repeat the above operation for each cluster to obtain the suspected crack areas in the trash can image on day t.
[0050] S4. Perform spatiotemporal matching verification on images of multiple consecutive suspected crack areas, and determine the suspected crack area that meets the positional stability condition as the real crack area.
[0051] Step S4 further includes: S41. Collect multiple images of trash cans continuously and obtain the corresponding suspected crack areas for each; the multiple trash can images are collected on a daily basis; S42. For any suspected crack area in an image, search for the corresponding area that satisfies the positional stability condition in the suspected crack areas of subsequent images.
[0052] In steps S41 to S42 of this invention, firstly, for the trash can image on day t, the trash can region and box coordinates are obtained through a target detection model, a set of color change points is extracted through a color gradient algorithm, and the suspected crack region and its relative rectangular coordinates on day t are obtained through clustering and geometric feature filtering. At the same time, for the trash can images on days t+1 and t+2, this invention performs the same processing flow to obtain the suspected crack region and its relative rectangular coordinates on days t+1 and t+2, respectively.
[0053] S43. Determine whether there are multiple images where the suspected crack area meets the second preset condition. When all of them meet the second preset condition, the current suspected crack area that meets the positional stability condition is determined as the real crack area.
[0054] The expression for the second preset condition in step S43 is: in, Indicates the time index value. Let x be the x-coordinate of the left vertex of the suspected crack region on day t. Let y be the left vertex coordinate of the suspected crack region on day t. The width of the suspected crack area on day t. The height of the suspected crack area on day t; Let x be the x-coordinate of the left vertex of the suspected crack region on day t+1. Let y be the left vertex coordinate of the suspected crack region on day t+1. The width of the suspected crack area on day t+1. The height of the suspected crack area on day t+1; Let x be the x-coordinate of the left vertex of the suspected crack region on day t+2. Let y be the left vertex coordinate of the suspected crack area on day t+2. The width of the suspected crack area on day t+2. The high value of the suspected crack area on day t+2.
[0055] Subsequently, this invention applies to any suspected crack area on day t. On day t+1, check each suspected crack area to see if any area exists. The first four conditions for positional stability are met. Simultaneously, this invention checks for the presence of regions in all suspected crack areas on day t+2. Together with the suspected crack regions on day t and day t+1, they satisfy all eight positional stability conditions.
[0056] Furthermore, based on the above conditions, the suspected crack area can be definitively identified. The cracked area is defined, and the corresponding area is defined for t+2 days. Return to the front end to display an alert for cracks on the surface of the trash can.
[0057] like Figure 2 As shown, the present invention also provides a vision-based system for detecting surface cracks in trash cans, comprising: Segmentation module 100: Used to segment the trash can image using a target detection model to obtain the trash can region and target coordinates; Extraction module 200: used to extract edge features of pixels in the trash can area using a color gradient algorithm to obtain a set of color abrupt change points; Screening module 300: used to cluster the set of color mutation points according to the continuity criterion to obtain multiple color mutation clusters, and to screen suspected crack areas based on geometric features; Identification module 400: used to perform spatiotemporal matching verification on images of multiple consecutive suspected crack areas, and to determine the suspected crack area that meets the positional stability condition as the real crack area.
[0058] The present invention also provides a vision-based device for detecting surface cracks in trash cans, comprising: A memory and at least one processor, wherein the memory stores instructions; At least one of the processors invokes the instructions in the memory to cause a vision-based trash can surface crack detection device to perform a vision-based trash can surface crack detection method as described in any of the preceding claims.
[0059] The present invention also provides a computer-readable storage medium storing instructions that, when executed by a processor, implement a vision-based method for detecting surface cracks in a trash can as described in any of the preceding claims.
[0060] This invention provides a method for detecting surface cracks in trash cans that can effectively distinguish between real cracks and interference noise, adapt to complex environments, and has high accuracy, thus meeting the needs of smart city construction and intelligent management of sanitation facilities.
[0061] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A vision-based method for detecting surface cracks in trash cans, characterized in that, include: S1. The trash can image is segmented using a target detection model to obtain the trash can region and target coordinates; S2. Extract edge features from pixels within the trash can area using a color gradient algorithm to obtain a set of color abrupt change points; S3. Cluster the set of color mutation points according to the continuity criterion to obtain multiple color mutation clusters, and select suspected crack areas based on geometric features. S4. Perform spatiotemporal matching verification on images of multiple consecutive suspected crack areas, and determine the suspected crack area that meets the positional stability condition as the real crack area.
2. The vision-based method for detecting surface cracks in a trash can according to claim 1, characterized in that, Step S1 further includes: S11. Capture images of the trash can; S12. The trash can image is smoothed by Gaussian filtering to obtain noise-reduced image data; S13. Input the denoised image data into the MaskR-CNN model to obtain the coordinates of the target box where the trash can is located, the trash can area within the target box, and the RGB coordinates of the pixels.
3. The vision-based method for detecting surface cracks in a trash can according to claim 1, characterized in that, Step S2 further includes: S21. Calculate the gradient value of each pixel in the trash can area across multiple color channels; S22. Merge the gradient values of multiple color channels and calculate the comprehensive color features of the corresponding pixel. S23. Pixels whose comprehensive color features are greater than or equal to the first preset threshold are identified as color mutation points, and a set of color mutation points is obtained.
4. The vision-based method for detecting surface cracks in a trash can according to claim 1, characterized in that, Step S3 further includes: S31. Select any color mutation point in the set of color mutation points as the initial point, add color mutation points whose pixel distance from the initial point is less than a preset parameter to the same cluster, and continuously optimize the neighboring points of the newly added points until all the neighboring points of all points in the current cluster are in the cluster, thus obtaining multiple color mutation clusters. S32. For a single color mutation cluster, calculate the parameters of the bounding rectangle; S33. Identify the internal pixels surrounded by the color mutation cluster within the outer rectangle of the color mutation cluster, and form a set of shadow points together with the internal pixels and the corresponding color mutation cluster. Count the number of points in the set of shadow points. S34. When the area ratio of the set of shadow points is greater than the second preset threshold and less than the third preset threshold, calculate the geometric features of the set of shadow points, including aspect ratio, extension and compactness. S35. Based on the geometric features and the first preset conditions, a suspected crack area is selected and the relative rectangular coordinates of the suspected crack area are recorded.
5. The vision-based method for detecting surface cracks in a trash can according to claim 4, characterized in that, The expression for the first preset condition in step S35 is: in, Aspect ratio, For extension, For compactness.
6. The vision-based method for detecting surface cracks in a trash can according to claim 1, characterized in that, Step S4 further includes: S41. Collect multiple images of trash cans continuously and obtain the corresponding suspected crack areas for each; S42. For any suspected crack region in an image, search for a corresponding region that satisfies the positional stability condition in the suspected crack regions of subsequent images. S43. Determine whether there are multiple images where the suspected crack area meets the second preset condition. When all of them meet the second preset condition, the current suspected crack area that meets the positional stability condition is determined as the real crack area.
7. The vision-based method for detecting surface cracks in a trash can according to claim 6, characterized in that, The multiple trash can images in step S41 are collected on a daily basis, and the expression for the second preset condition in step S43 is: in, Indicates the time index value. Let x be the x-coordinate of the left vertex of the suspected crack region on day t. Let y be the left vertex coordinate of the suspected crack region on day t. The width of the suspected crack area on day t. The height of the suspected crack area on day t; Let x be the x-coordinate of the left vertex of the suspected crack region on day t+1. Let y be the left vertex coordinate of the suspected crack region on day t+1. The width of the suspected crack area on day t+1. The height of the suspected crack area on day t+1; Let x be the x-coordinate of the left vertex of the suspected crack region on day t+2. Let y be the left vertex coordinate of the suspected crack area on day t+2. The width of the suspected crack area on day t+2. The high value of the suspected crack area on day t+2.
8. A vision-based system for detecting surface cracks in trash cans, characterized in that, include: Segmentation module: Used to segment trash can images using an object detection model to obtain the trash can region and object coordinates; Extraction module: used to extract edge features of pixels in the trash can area using a color gradient algorithm to obtain a set of color abrupt change points; Screening module: used to cluster the set of color mutation points according to the continuity criterion to obtain multiple color mutation clusters, and to screen suspected crack areas based on geometric features; Identification module: used to perform spatiotemporal matching verification on images of multiple consecutive suspected crack areas, and to determine the suspected crack area that meets the positional stability condition as the real crack area.
9. A vision-based device for detecting surface cracks in trash cans, characterized in that, include: A memory and at least one processor, wherein the memory stores instructions; At least one of the processors invokes the instructions in the memory to cause a vision-based trash can surface crack detection device to perform a vision-based trash can surface crack detection method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by a processor, implement a vision-based method for detecting surface cracks in a trash can as described in any one of claims 1 to 7.