Road cleanliness testing methods, devices, electronic equipment and storage media

By dividing road images into sub-regions and calculating similarity, and combining dynamic difference thresholds and road marking gray values, road cleanliness can be accurately identified, solving the problem of low efficiency in manual observation and improving the efficiency and management convenience of road cleanliness detection.

CN121661052BActive Publication Date: 2026-05-26ZHONGTONG CONSTR ENG & URBAN CONSTR GRP CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHONGTONG CONSTR ENG & URBAN CONSTR GRP CO LTD
Filing Date
2026-02-06
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In existing technologies, manually observing road cleanliness is inefficient, time-consuming, and labor-intensive, making it difficult to efficiently identify objects to be cleaned.

Method used

By acquiring road images, dividing them into multiple sub-regions, statistically analyzing pixel distribution, calculating similarity, identifying objects to be cleaned in target sub-regions, and combining dynamic difference thresholds and road marking grayscale values, the area occupied by the objects to be cleaned can be accurately identified.

Benefits of technology

It enables efficient identification of road cleanliness, reduces the frequency of sanitation worker patrols, improves the efficiency of cleanliness detection, and facilitates road cleaning management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121661052B_ABST
    Figure CN121661052B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, electronic device, and storage medium for road cleanliness detection, relating to the field of road detection technology. The method includes: acquiring a road image to be detected; dividing the road image into multiple sub-regions according to a preset division method; statistically analyzing the pixel distribution of each sub-region to obtain multiple pixel histograms to be processed; acquiring multiple preset pixel histograms, each preset pixel histogram being obtained by statistically analyzing the pixels of the sub-regions in a clean state; calculating the similarity between each pixel histogram to be processed and the corresponding preset pixel histogram to obtain multiple similarities; using the similarity scores below a similarity threshold as target similarities, and using the sub-regions corresponding to the target similarities as target sub-regions; identifying the areas occupied by objects to be cleaned in each target sub-region, and determining the road cleanliness based on the areas occupied by objects to be cleaned in each target sub-region. This method can efficiently identify objects to be cleaned.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of road inspection technology, and in particular to a method, apparatus, electronic device and storage medium for road cleanliness inspection. Background Technology

[0002] As society develops, people have higher and higher requirements for civilized cities, and building civilized cities places higher demands on the cleanliness of urban roads.

[0003] In related technologies, the cleanliness of urban roads is mainly determined by sanitation workers who observe the roads and then clean them after identifying objects that need cleaning (such as garbage bags).

[0004] However, manually observing whether the roads are clean requires a large number of sanitation workers to patrol the roads, which is inefficient, time-consuming and laborious. Summary of the Invention

[0005] This application provides a method, apparatus, electronic device, and storage medium for detecting road cleanliness, which at least to some extent overcomes the problems of low efficiency and time-consuming and laborious nature of manually observing whether a road is clean in related technologies.

[0006] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.

[0007] According to one aspect of this application, a road cleanliness detection method is provided, comprising: acquiring a road image to be detected; dividing the road image to be detected into multiple sub-regions according to a preset division method; statistically analyzing the pixel distribution of each sub-region to obtain multiple pixel histograms to be processed; acquiring multiple preset pixel histograms, each preset pixel histogram being obtained by statistically analyzing the pixels of a sub-region in a clean state; calculating the similarity between each pixel histogram to be processed and the corresponding preset pixel histogram to obtain multiple similarities; taking the similarity below a similarity threshold among the multiple similarities as the target similarity, and taking the sub-region corresponding to the target similarity as the target sub-region; identifying the area occupied by the object to be cleaned in each target sub-region, and determining the cleanliness of the road based on the area occupied by the object to be cleaned in each target sub-region.

[0008] The method of determining road cleanliness by using past images of roads to be inspected and identifying the areas occupied by objects to be cleaned in those images is more efficient than manual observation, thus avoiding the need for sanitation workers to patrol the streets frequently.

[0009] Furthermore, since the actual road area corresponding to the road image to be detected is usually large, while the area of ​​the object to be cleaned on the ground is generally small, the object to be cleaned usually occupies a small area in the road image to be detected, making it difficult to find the object to be cleaned by direct detection or comparison with a clean image. However, by dividing the image to be detected into multiple sub-regions, statistically analyzing the pixel distribution in each sub-region, calculating the similarity between the resulting pixel histogram and a preset pixel histogram, and selecting the target sub-region based on the similarity threshold, the sub-regions containing the object to be cleaned can be accurately identified.

[0010] Furthermore, by identifying the size of the area occupied by the object to be cleaned in the target sub-region, the cleanliness level of the road can be determined, which further facilitates the management of road cleaning.

[0011] In some embodiments, among the multiple sub-regions divided according to the preset division method, the sub-regions that are closer to the camera that captured the image of the road to be detected have larger areas.

[0012] The farther a road is from the camera, the greater its reduction ratio in the image of the road to be detected. Therefore, by setting the preset division method as in the example, the objects to be cleaned in the more distant sub-regions can occupy a larger proportion of the area, which makes it easier to identify the objects to be cleaned in the more distant sub-regions.

[0013] In some embodiments, identifying the area occupied by the object to be cleaned in each target sub-region includes: for each target sub-region, identifying the difference in grayscale value between each adjacent pixel in the target sub-region, and comparing the difference with a dynamic difference threshold; determining the pixel whose difference is greater than the dynamic difference threshold and is close to the edge of the target sub-region as the first pixel; and determining the area occupied by the object to be cleaned based on the area enclosed by the first pixel.

[0014] Urban roads are paved with asphalt, and their surfaces are often a single color. The method described in this embodiment can identify areas with abrupt changes in grayscale values ​​within a sub-region. These areas typically represent the outline of the object to be cleaned in the road image. By determining the first pixel, the area occupied by the object to be cleaned can be accurately identified based on that first pixel.

[0015] In some embodiments, the dynamic difference threshold is determined based on the grayscale values ​​of pixels within a preset range, wherein the preset range is a rectangular area with the midpoint between two adjacent pixels as the center point and a preset number of pixels as the side length.

[0016] The objects to be cleaned come in a variety of colors, and some of them are similar in color to the asphalt pavement. Therefore, by configuring a dynamic difference threshold in this embodiment, the problem of failing to identify some similarly colored objects due to a fixed threshold can be avoided, thus achieving more comprehensive identification of the objects to be cleaned.

[0017] In some embodiments, the dynamic difference threshold is half of the maximum pixel difference, where the maximum pixel difference is the difference between the maximum and minimum grayscale values ​​of pixels within the preset range.

[0018] In some embodiments, determining the area occupied by the object to be cleaned based on the area enclosed by the first pixel includes: removing the first pixel whose difference belongs to a preset difference range, and using the remaining first pixel as the second pixel, wherein the preset difference range is determined based on the difference between the gray value of the road line and the gray value of the road surface; and using the area enclosed by the second pixel as the area occupied by the object to be cleaned.

[0019] Urban roads typically have road markings (lane lines, directional lines, etc.). The color of the road markings is fixed, and the grayscale difference between the road marking area and the road surface is also relatively fixed. Therefore, through the method in the embodiment, the pixels in the first pixel that belong to the road markings (pixels of the road surface adjacent to the road markings and pixels of the road markings) can be removed, and only the pixels corresponding to the object to be cleaned are retained. This makes the area enclosed by the second pixel the area occupied by the object to be cleaned, thus achieving more accurate identification of the area occupied by the road markings to be cleaned.

[0020] According to another aspect of this application, a road cleanliness detection device is also provided, comprising: a first acquisition module for acquiring a road image to be detected; a division module for dividing the road image to be detected into multiple sub-regions according to a preset division method; a statistics module for statistically analyzing the pixel distribution of each sub-region to obtain multiple pixel histograms to be processed; a second acquisition module for acquiring multiple preset pixel histograms, each preset pixel histogram being obtained by pixel statistics of sub-regions in a clean state; a calculation module for calculating the similarity between each pixel histogram to be processed and the corresponding preset pixel histogram to obtain multiple similarities; and an identification module for taking the similarity below a similarity threshold among the multiple similarities as target similarities, and taking the sub-region corresponding to the target similarity as a target sub-region; identifying the area occupied by the object to be cleaned in each target sub-region, and determining the cleanliness of the road based on the area occupied by the object to be cleaned in each target sub-region.

[0021] In some embodiments, the identification module is configured to identify the difference in grayscale value between each adjacent pixel in the target sub-region for each target sub-region, and compare the difference with a dynamic difference threshold; determine the pixel whose difference is greater than the dynamic difference threshold and is close to the edge of the target sub-region as the first pixel; and determine the area occupied by the object to be cleaned based on the area surrounded by the first pixel.

[0022] In some embodiments, the identification module is used to remove first pixels whose differences belong to a preset difference range from the first pixels, and to use the remaining first pixels as second pixels. The preset difference range is determined based on the difference between the gray values ​​of the road markings and the gray values ​​of the road surface. The area enclosed by the second pixels is used as the area occupied by the object to be cleaned.

[0023] According to another aspect of this application, an electronic device is also provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the road cleanliness detection method described in any one of the preceding claims by executing the executable instructions.

[0024] According to another aspect of this application, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the road cleanliness detection method described in any one of the preceding claims.

[0025] According to another aspect of this application, a computer program product is also provided, comprising a computer program that, when executed by a processor, implements the road cleanliness detection method of any one of the above. Attached Figure Description

[0026] Figure 1 This document shows a flowchart of a road cleanliness detection method according to one embodiment of the present application;

[0027] Figure 2 This illustration shows a schematic diagram of a road cleanliness detection device in one embodiment of this application;

[0028] Figure 3 This diagram illustrates the structure of an electronic device according to one embodiment of the present application. Detailed Implementation

[0029] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0030] Furthermore, the accompanying drawings are merely illustrative of this application and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0031] It should be noted that the acquisition, storage, use, and processing of road images in this application all comply with the relevant provisions of national laws and regulations.

[0032] Figure 1 This application illustrates a flowchart of a road cleanliness detection method according to an embodiment of the present application. Figure 1 As shown, the road cleanliness detection method provided in this embodiment includes the following steps S101-S107. This method can be executed by a device equipped with an imaging device, or by other electronic devices that can acquire images of the road to be detected from the imaging device.

[0033] S101, Obtain the image of the road to be detected.

[0034] In some embodiments, the electronic device performing this method is equipped with a camera, which can directly capture road images to obtain the road image to be detected.

[0035] In some embodiments, the electronic device performing this method is connected to the imaging device via a network, thereby acquiring images of the road to be detected from the imaging device.

[0036] In some embodiments, other electronic devices may send the acquired road image to be detected to the electronic device performing this method.

[0037] The road image to be detected is an image that includes roads.

[0038] S102, the road image to be detected is divided into multiple sub-regions according to a preset division method.

[0039] The embodiments of this application do not limit the specific type of preset division method. For example, it may be to divide the road image to be detected into equal parts.

[0040] In some embodiments, among the multiple sub-regions divided according to a preset division method, the sub-regions that are closer to the camera that captured the image of the road to be detected have larger areas.

[0041] The farther a road is from the camera, the greater its reduction ratio in the image of the road to be detected. Therefore, by setting the preset division method as in the example, the objects to be cleaned in the more distant sub-regions can occupy a larger proportion of the area, which makes it easier to identify the objects to be cleaned in the more distant sub-regions.

[0042] The embodiments of this application do not limit the specific number of sub-regions, and can be set based on experience.

[0043] S103, statistically analyze the pixel distribution of each sub-region to obtain multiple pixel histograms to be processed.

[0044] In some embodiments, each pixel in the road image to be detected can be assigned a value according to the RGB color space to obtain the pixel value of each pixel.

[0045] In other embodiments, each pixel in the road image to be detected can be copied according to grayscale to obtain the grayscale value of each pixel.

[0046] Once the grayscale value or pixel value of each pixel is determined, the pixel distribution of each sub-region can be statistically analyzed to obtain multiple pixel histograms to be processed.

[0047] S104, acquire multiple preset pixel histograms, each preset pixel histogram is obtained by pixel statistics of sub-regions in a clean state.

[0048] Among them, multiple preset pixel histograms correspond to multiple sub-regions in a clean state. These multiple sub-regions in a clean state form an image of a road in a clean state. It should be noted that the image of this road is captured at the same position and angle as the image of the road to be detected.

[0049] S105, calculate the similarity between each pixel histogram to be processed and the corresponding preset pixel histogram to obtain multiple similarity scores.

[0050] The embodiments of this application do not limit how to calculate the similarity between the histogram of the pixel to be processed and the corresponding preset pixel histogram.

[0051] For example, the similarity can be calculated using any of the following methods: histogram intersection, Bach distance, chi-square test, Euclidean distance, and correlation coefficient.

[0052] S106, among multiple similarities, the similarity below the similarity threshold is taken as the target similarity, and the sub-region corresponding to the target similarity is taken as the target sub-region.

[0053] The embodiments of this application do not impose any restrictions on the specific value of the similarity threshold, and it can be set based on experience. For example, the similarity threshold is 0.95. Another example is a similarity threshold of 0.90.

[0054] S107, identify the area occupied by the object to be cleaned in each target sub-region, and determine the cleanliness of the road based on the area occupied by the object to be cleaned in each target sub-region.

[0055] In some embodiments, identifying the area occupied by the object to be cleaned in each target sub-region may include: for each target sub-region, identifying the difference in grayscale value between each adjacent pixel in the target sub-region, and comparing the difference with a dynamic difference threshold; determining the pixel whose difference is greater than the dynamic difference threshold and is close to the edge of the target sub-region as the first pixel; and determining the area occupied by the object to be cleaned based on the area enclosed by the first pixel.

[0056] Urban roads are paved with asphalt, and their surfaces are often a single color. The method described in this embodiment can identify areas with abrupt changes in grayscale values ​​within a sub-region. These areas typically represent the outline of the object to be cleaned in the road image. By determining the first pixel, the area occupied by the object to be cleaned can be accurately identified based on that first pixel.

[0057] In some embodiments, the dynamic difference threshold is determined based on the grayscale values ​​of pixels within a preset range, where the preset range is a rectangular area with the midpoint between two adjacent pixels as the center point and a preset number of pixels as the side length.

[0058] The embodiments of this application do not limit the specific value of the preset number of pixels, and it can be set based on experience. For example, the preset number of pixels is 5.

[0059] The objects to be cleaned come in a variety of colors, and some of them are similar in color to the asphalt pavement. Therefore, by configuring a dynamic difference threshold in this embodiment, the problem of failing to identify some similarly colored objects due to a fixed threshold can be avoided, thus achieving more comprehensive identification of the objects to be cleaned.

[0060] In some embodiments, the dynamic difference threshold is half of the maximum pixel difference, where the maximum pixel difference is the difference between the maximum and minimum grayscale values ​​of pixels within a preset range.

[0061] In some embodiments, determining the area occupied by the object to be cleaned based on the area enclosed by the first pixel includes: removing the first pixel whose corresponding difference belongs to a preset difference range, and using the remaining first pixel as the second pixel, wherein the preset difference range is determined based on the difference between the gray value of the road line and the gray value of the road surface; and using the area enclosed by the second pixel as the area occupied by the object to be cleaned.

[0062] Urban roads typically have road markings (lane lines, directional lines, etc.). The color of the road markings is fixed, and the grayscale difference between the road marking area and the road surface is also relatively fixed. Therefore, through the method in the embodiment, the pixels in the first pixel that belong to the road markings (pixels of the road surface adjacent to the road markings and pixels of the road markings) can be removed, and only the pixels corresponding to the object to be cleaned are retained. This makes the area enclosed by the second pixel the area occupied by the object to be cleaned, thus achieving more accurate identification of the area occupied by the road markings to be cleaned.

[0063] The method of determining road cleanliness by using past images of roads to be inspected and identifying the areas occupied by objects to be cleaned in those images is more efficient than manual observation, thus avoiding the need for sanitation workers to patrol the streets frequently.

[0064] Furthermore, since the actual road area corresponding to the road image to be detected is usually large, while the area of ​​the object to be cleaned on the ground is generally small, the object to be cleaned usually occupies a small area in the road image to be detected, making it difficult to find the object to be cleaned by direct detection or comparison with a clean image. However, by dividing the image to be detected into multiple sub-regions, statistically analyzing the pixel distribution in each sub-region, calculating the similarity between the resulting pixel histogram and a preset pixel histogram, and selecting the target sub-region based on the similarity threshold, the sub-regions containing the object to be cleaned can be accurately identified.

[0065] Furthermore, by identifying the size of the area occupied by the object to be cleaned in the target sub-region, the cleanliness level of the road can be determined, which further facilitates the management of road cleaning.

[0066] Based on the same inventive concept, this application also provides a road cleanliness detection device, as shown in the following embodiment. Since the principle by which this device solves the problem is similar to that of the method embodiment described above, the implementation of this device embodiment can refer to the implementation of the method embodiment described above, and repeated details will not be elaborated further.

[0067] Figure 2 This illustration shows a schematic diagram of a road cleanliness detection device according to an embodiment of this application, such as... Figure 2As shown, the device includes: a first acquisition module 21 for acquiring an image of the road to be detected; a segmentation module 22 for dividing the image of the road to be detected into multiple sub-regions according to a preset segmentation method; a statistics module 23 for statistically analyzing the pixel distribution of each sub-region to obtain multiple pixel histograms to be processed; a second acquisition module 24 for acquiring multiple preset pixel histograms, each preset pixel histogram being obtained by performing pixel statistics on the sub-regions in a clean state; a calculation module 25 for calculating the similarity between each pixel histogram to be processed and the corresponding preset pixel histogram to obtain multiple similarities; and an identification module 26 for taking the similarity scores below a similarity threshold as target similarities, taking the sub-regions corresponding to the target similarities as target sub-regions; identifying the areas occupied by the objects to be cleaned in each target sub-region, and determining the cleanliness of the road based on the areas occupied by the objects to be cleaned in each target sub-region.

[0068] In some embodiments, the identification module 26 is configured to identify the difference in grayscale value between each adjacent pixel in the target sub-region for each target sub-region, and compare the difference with a dynamic difference threshold; determine the pixel whose difference is greater than the dynamic difference threshold and is close to the edge of the target sub-region as the first pixel; and determine the area occupied by the object to be cleaned based on the area enclosed by the first pixel.

[0069] In some embodiments, the identification module 26 is used to remove first pixels whose corresponding differences belong to a preset difference range, and use the remaining first pixels as second pixels. The preset difference range is determined based on the difference between the gray values ​​of the road markings and the gray values ​​of the road surface. The area enclosed by the second pixel is used as the area occupied by the object to be cleaned.

[0070] The method of determining road cleanliness by using past images of roads to be inspected and identifying the areas occupied by objects to be cleaned in those images is more efficient than manual observation, thus avoiding the need for sanitation workers to patrol the streets frequently.

[0071] Furthermore, since the actual road area corresponding to the road image to be detected is usually large, while the area of ​​the object to be cleaned on the ground is generally small, the object to be cleaned usually occupies a small area in the road image to be detected, making it difficult to find the object to be cleaned by direct detection or comparison with a clean image. However, by dividing the image to be detected into multiple sub-regions, statistically analyzing the pixel distribution in each sub-region, calculating the similarity between the resulting pixel histogram and a preset pixel histogram, and selecting the target sub-region based on the similarity threshold, the sub-regions containing the object to be cleaned can be accurately identified.

[0072] Furthermore, by identifying the size of the area occupied by the object to be cleaned in the target sub-region, the cleanliness level of the road can be determined, which further facilitates the management of road cleaning.

[0073] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."

[0074] The following reference Figure 3 To describe an electronic device 300 according to this embodiment of the present application. Figure 3 The electronic device 300 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0075] like Figure 3 As shown, the electronic device 300 is presented in the form of a general-purpose computing device. The components of the electronic device 300 may include, but are not limited to: at least one processing unit 310, at least one storage unit 320, and a bus 330 connecting different system components (including storage unit 320 and processing unit 310).

[0076] The storage unit stores program code that can be executed by the processing unit 310, causing the processing unit 310 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this application. For example, the processing unit 310 can perform the following steps of the above method embodiments: S101-S107.

[0077] Storage unit 320 may include readable media in the form of volatile storage units, such as random access memory (RAM) 3201 and / or cache memory 3202, and may further include read-only memory (ROM) 3203.

[0078] Storage unit 320 may also include a program / utility 3204 having a set (at least one) program module 3205, such program module 3205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0079] Bus 330 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0080] Electronic device 300 can also communicate with one or more external devices 340 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 300, and / or with any device that enables electronic device 300 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 350. Furthermore, electronic device 300 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 360. As shown, network adapter 360 communicates with other modules of electronic device 300 via bus 330. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0081] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this application.

[0082] In particular, according to embodiments of this application, the process described in the above-mentioned flowchart can be implemented as a computer program product, which includes a computer program that, when executed by a processor, implements the above-described road cleanliness detection method.

[0083] In an exemplary embodiment of this application, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. The computer-readable storage medium stores a program product capable of implementing the methods described above in this application.

[0084] In some possible implementations, various aspects of this application may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this application.

[0085] More specific examples of computer-readable storage media in this application may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0086] In this application, a computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable signal medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0087] Optionally, the program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0088] In practical implementation, program code for performing the operations of this application can be written using any combination of one or more programming languages. These programming languages ​​include object-oriented programming languages—such as Java and C++—and conventional procedural programming languages—such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0089] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0090] Furthermore, although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0091] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this application.

[0092] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the appended claims.

Claims

1. A method for detecting road cleanliness, characterized in that, include: Obtain the image of the road to be detected; The road image to be detected is divided into multiple sub-regions according to a preset division method; The pixel distribution of each sub-region is statistically analyzed to obtain multiple pixel histograms to be processed; Multiple preset pixel histograms are obtained, and each preset pixel histogram is obtained by pixel statistics of a sub-region in a clean state; Calculate the similarity between the histogram of each pixel to be processed and the corresponding preset pixel histogram to obtain multiple similarity scores; The similarity scores below the similarity threshold among the multiple similarity scores are taken as the target similarity scores, and the sub-regions corresponding to the target similarity scores are taken as the target sub-regions. Identify the area occupied by the object to be cleaned in each target sub-region, and determine the cleanliness of the road based on the area occupied by the object to be cleaned in each target sub-region; The step of identifying the area occupied by the object to be cleaned in each target sub-region includes: for each target sub-region, identifying the difference in grayscale value of each adjacent pixel in the target sub-region, and comparing the difference with a dynamic difference threshold. The pixel whose difference is greater than the dynamic difference threshold and is close to the edge of the target sub-region is identified as the first pixel; the area occupied by the object to be cleaned is determined based on the area enclosed by the first pixel.

2. The road cleanliness detection method according to claim 1, characterized in that, Among the multiple sub-regions divided according to the preset division method, the sub-regions that are closer to the camera that captured the image of the road to be detected have larger areas.

3. The road cleanliness detection method according to claim 1, characterized in that, The dynamic difference threshold is determined based on the grayscale values ​​of pixels within a preset range. The preset range is a rectangular area with the midpoint between two adjacent pixels as the center point and a preset number of pixels as the side length.

4. The road cleanliness detection method according to claim 3, characterized in that, The dynamic difference threshold is half of the maximum pixel difference, where the maximum pixel difference is the difference between the maximum and minimum grayscale values ​​of pixels within the preset range.

5. The road cleanliness detection method according to claim 1, characterized in that, Determining the area occupied by the object to be cleaned based on the area enclosed by the first pixel includes: Remove the first pixel whose difference belongs to a preset difference range from the first pixel, and use the remaining first pixel as the second pixel. The preset difference range is determined based on the difference between the gray value of the road line and the gray value of the road surface. The area enclosed by the second pixel is taken as the area to be cleaned.

6. A road cleanliness detection device, characterized in that, include: The first acquisition module is used to acquire the image of the road to be detected; The segmentation module is used to divide the road image to be detected into multiple sub-regions according to a preset segmentation method; The statistics module is used to statistically analyze the pixel distribution of each sub-region and obtain multiple pixel histograms to be processed. The second acquisition module is used to acquire multiple preset pixel histograms. Each preset pixel histogram is obtained by pixel statistics of a sub-region in a clean state. The calculation module is used to calculate the similarity between each pixel histogram to be processed and the corresponding preset pixel histogram, and obtain multiple similarity scores. The identification module is used to take the similarity scores below the similarity threshold among the multiple similarity scores as the target similarity scores, and take the sub-regions corresponding to the target similarity scores as the target sub-regions; identify the areas occupied by the objects to be cleaned in each target sub-region, and determine the cleanliness of the road based on the areas occupied by the objects to be cleaned in each target sub-region; The step of identifying the area occupied by the object to be cleaned in each target sub-region includes: for each target sub-region, identifying the difference in grayscale value of each adjacent pixel in the target sub-region, and comparing the difference with a dynamic difference threshold. The pixel whose difference is greater than the dynamic difference threshold and is close to the edge of the target sub-region is identified as the first pixel; the area occupied by the object to be cleaned is determined based on the area enclosed by the first pixel.

7. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the road cleanliness detection method according to any one of claims 1 to 5 by executing the executable instructions.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the road cleanliness detection method according to any one of claims 1 to 5.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the road cleanliness detection method according to any one of claims 1 to 5.