Garbage full barrel detection method, device and equipment and storage medium
By acquiring the information entropy of the trash can opening area and fitting a full-can threshold, and combining this with an asymmetric double Gaussian function to process the image entropy value, the problem of low efficiency and insufficient accuracy in trash can full detection is solved, achieving efficient and accurate trash can full detection.
Patent Information
- Application Number
- CN202011612896.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-29
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2040-12-29
AI Technical Summary
Existing technologies for detecting full trash cans are inefficient and produce inaccurate results. Deep learning models require a large number of labeled samples and consume significant hardware resources, which limits their application in embedded devices.
By obtaining the information entropy of the sample trash can opening area, fitting the full-can entropy threshold using a standard normal distribution function, and combining it with an asymmetric double Gaussian function to process the entropy value of the image to be detected, the full-can detection of trash cans is achieved.
It improves the efficiency and accuracy of garbage bin full detection, simplifies the model training process, and reduces hardware resource requirements.
Smart Images

Figure CN114758166B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and particularly relates to a garbage full bin detection method and device, equipment and a storage medium. BACKGROUND
[0002] The problem that garbage cannot be timely cleaned and transported after the garbage bin is full is a problem that is strongly reflected by community residents, and directly affects the service quality evaluation of the property. In the prior art, one method is to clean and transport the garbage at a fixed time after the garbage is put in at a fixed time, but this method is time triggered, which limits the freedom of the residents to put in the garbage, and on the other hand, if the garbage bin is not full at the time of cleaning and transportation, the transport capacity is wasted. Another method is to detect the full garbage bin through model training, but this method also has several difficulties. First, a large number of and diverse labeled samples are needed for deep learning, otherwise the model may be over-fitted during training, and the effect is not ideal during inference. Second, the deep learning model generally needs to occupy a certain amount of hardware resources, from tens of MB to hundreds of MB, and its application is limited in a hardware resource limited scene (such as an embedded device). Third, the detection efficiency of the prior art is low, and the detection result is not accurate.
[0003] The above content is only used to assist in understanding the technical solutions of the present application, and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0004] The main purpose of the present application is to provide a garbage full bin detection method, device, equipment and storage medium, which aims to solve the technical problem of how to improve the detection efficiency of the full garbage bin, and further improve the accuracy of detecting the full garbage bin.
[0005] To achieve the above purpose, the present application provides a garbage full bin detection method, which comprises:
[0006] Obtaining sample information entropy of a sample garbage bin mouth area, and fitting the sample information entropy according to a standard normal distribution function to obtain a full bin entropy threshold;
[0007] Obtaining a to-be-detected image of a to-be-detected garbage bin mouth area, and determining a to-be-detected sample entropy value according to the to-be-detected image;
[0008] Full bin detection is performed on the to-be-detected garbage bin according to the full bin entropy threshold and the to-be-detected sample entropy value.
[0009] Optionally, the step of obtaining the sample information entropy of the sample garbage bin mouth area comprises:
[0010] Obtaining a sample garbage bin mouth area image, and performing gray scale processing on the sample garbage bin mouth area image to obtain a sample gray scale image;
[0011] Obtaining a sample information entropy of the sample gray scale image;
[0012] determine a unary gray entropy according to the sample gray image;
[0013] process the unary gray entropy to obtain a sample information entropy of a sample garbage can mouth area.
[0014] Optionally, the step of determining the unary gray entropy according to the sample gray image comprises:
[0015] obtain a plurality of sample gray values according to the sample gray image;
[0016] determine a quantity of pixel points corresponding to each sample gray value and a total quantity of pixels;
[0017] obtain the unary gray entropy according to each sample gray value, the quantity of pixel points corresponding to each sample gray value and the total quantity of pixels.
[0018] Optionally, the step of obtaining the unary gray entropy according to each sample gray value, the quantity of pixel points corresponding to each sample gray value and the total quantity of pixels comprises:
[0019] obtain the unary gray entropy according to each sample gray value, the quantity of pixel points corresponding to each sample gray value and the total quantity of pixels by a preset gray entropy formula;
[0020] the preset gray entropy formula is:
[0021]
[0022] in the formula, C ijk is the quantity of pixel points with a gray value of k in the jth sample gray image of the sample garbage can i, C ij* is the total quantity of pixels, H ij is the unary gray entropy.
[0023] Optionally, the step of processing the unary gray entropy to obtain the sample information entropy of the sample garbage can mouth area comprises:
[0024] determine a sample mean value and a sample standard deviation value according to the sample quantity corresponding to the sample garbage can mouth area image and the unary gray entropy;
[0025] perform standardization processing on the unary gray entropy according to the sample mean value and the sample standard deviation value to obtain a sample standardized entropy value, and take the sample standardized entropy value as the sample information entropy of the sample garbage can mouth area.
[0026] Optionally, the step of determining the sample mean value and the sample standard deviation value according to the sample quantity corresponding to the sample garbage can mouth area image and the unary gray entropy comprises:
[0027] According to the sample quantity corresponding to the sample garbage can mouth area image and the one-dimensional gray scale entropy, a sample mean value is determined.
[0028] According to the sample quantity corresponding to the sample garbage can mouth area image, the one-dimensional gray scale entropy and the sample mean value, a sample standard deviation value is determined.
[0029] Optionally, the step of determining the sample mean value according to the sample quantity corresponding to the sample garbage can mouth area image and the one-dimensional gray scale entropy comprises:
[0030] According to the sample quantity corresponding to the sample garbage can mouth area image and the one-dimensional gray scale entropy, a sample mean value is determined by a preset average formula.
[0031] The preset average formula is:
[0032]
[0033] In the formula, M is the sample quantity corresponding to the sample garbage can mouth area image, H i is the sample mean value.
[0034] Optionally, the step of determining the sample standard deviation value according to the sample quantity corresponding to the sample garbage can mouth area image, the one-dimensional gray scale entropy and the sample mean value comprises:
[0035] According to the sample quantity corresponding to the sample garbage can mouth area image, the one-dimensional gray scale entropy and the sample mean value, a sample standard deviation value is determined by a preset standard deviation formula.
[0036] The preset standard deviation formula is:
[0037]
[0038] In the formula, σ i is the sample standard deviation value.
[0039] Optionally, the step of determining the sample mean value according to the sample quantity corresponding to the sample garbage can mouth area image and the one-dimensional gray scale entropy comprises:
[0040] The step of determining the sample mean value according to the sample quantity corresponding to the sample garbage can mouth area image and the one-dimensional gray scale entropy comprises:
[0041] The step of determining the sample mean value according to the sample quantity corresponding to the sample garbage can mouth area image and the one-dimensional gray scale entropy comprises:
[0042] The step of determining the sample mean value according to the sample quantity corresponding to the sample garbage can mouth area image and the one-dimensional gray scale entropy comprises:
[0043] Optionally, the step of determining the sample mean value according to the sample quantity corresponding to the sample garbage can mouth area image and the one-dimensional gray scale entropy comprises:
[0044] fitting the target pixel value according to an asymmetric double Gaussian function, to obtain a pixel distribution curve;
[0045] determining a target normalized entropy value of the to-be-detected image according to the pixel distribution curve, and taking the target normalized entropy value as a to-be-detected sample entropy value.
[0046] Optionally, the step of determining the target normalized entropy value of the to-be-detected image according to the pixel distribution curve comprises:
[0047] determining a first Gaussian peak value and a second Gaussian peak value according to the pixel distribution curve;
[0048] judging whether the first Gaussian peak value and the second Gaussian peak value satisfy a preset peak condition;
[0049] when the first Gaussian peak value and the second Gaussian peak value satisfy the preset peak condition, determining the target normalized entropy value of the to-be-detected image according to the first Gaussian peak value and the second Gaussian peak value.
[0050] Optionally, after the step of performing full-bucket detection on the to-be-detected garbage bucket according to the full-bucket entropy threshold value and the to-be-detected sample entropy value, the method further comprises:
[0051] when it is detected that the to-be-detected garbage bucket is full, displaying a full-bucket prompt information.
[0052] In addition, to achieve the above object, the application further provides a garbage full-bucket detection device, which comprises:
[0053] an acquisition module, configured to acquire a sample information entropy of a sample garbage bucket mouth area, and fit the sample information entropy according to a standard normal distribution function to obtain a full-bucket entropy threshold value;
[0054] a determination module, configured to acquire a to-be-detected image of a to-be-detected garbage bucket mouth area, and determine a to-be-detected sample entropy value according to the to-be-detected image;
[0055] a detection module, configured to perform full-bucket detection on the to-be-detected garbage bucket according to the full-bucket entropy threshold value and the to-be-detected sample entropy value.
[0056] Optionally, the acquisition module is further configured to acquire a sample garbage bucket mouth area image, and perform gray scale processing on the sample garbage bucket mouth area image to obtain a sample gray scale image;
[0057] the acquisition module is further configured to determine a one-dimensional gray scale entropy according to the sample gray scale image;
[0058] The acquisition module is further configured to process the one-dimensional gray scale entropy to obtain sample information entropy of a sample garbage can spout area.
[0059] Optionally, the acquisition module is further configured to obtain a plurality of sample gray scale values according to the sample gray scale image.
[0060] The acquisition module is further configured to determine the number of pixel points corresponding to each sample gray scale value and the total number of pixels.
[0061] The acquisition module is further configured to obtain one-dimensional gray scale entropy according to each sample gray scale value, the number of pixel points corresponding to each sample gray scale value, and the total number of pixels.
[0062] Optionally, the acquisition module is further configured to calculate one-dimensional gray scale entropy according to each sample gray scale value, the number of pixel points corresponding to each sample gray scale value, and the total number of pixels through a preset gray scale entropy formula.
[0063] The preset gray scale entropy formula is as follows:
[0064]
[0065] In the formula, C ijk is the number of pixel points with a gray scale value of k in the jth sample gray scale image of the sample garbage can i, C ij* is the total number of pixels, H ij is one-dimensional gray scale entropy.
[0066] Optionally, the acquisition module is further configured to determine a sample mean value and a sample standard deviation value according to the number of samples corresponding to the sample garbage can spout area image and the one-dimensional gray scale entropy.
[0067] The acquisition module is further configured to perform standardization processing on the one-dimensional gray scale entropy according to the sample mean value and the sample standard deviation value, to obtain a sample standardization entropy value, and to take the sample standardization entropy value as a sample information entropy of the sample garbage can spout area.
[0068] Optionally, the acquisition module is further configured to determine a sample mean value according to the number of samples corresponding to the sample garbage can spout area image and the one-dimensional gray scale entropy.
[0069] The acquisition module is further configured to determine a sample standard deviation value according to the number of samples corresponding to the sample garbage can spout area image, the one-dimensional gray scale entropy, and the sample mean value.
[0070] In addition, to achieve the above object, the application further provides a garbage full can detection device, which comprises a memory, a processor, and a garbage full can detection program stored in the memory and capable of running on the processor, and the garbage full can detection program is configured to implement the steps of the garbage full can detection method as described above.
[0071] In addition, to achieve the above object, the application further provides a storage medium, wherein the storage medium stores a garbage full barrel detection program, and the garbage full barrel detection program is executed by a processor to realize the steps of the garbage full barrel detection method.
[0072] The application first acquires sample information entropy of a sample garbage barrel mouth area, and fits the sample information entropy according to a standard normal distribution function to obtain a full barrel entropy threshold value, then acquires a to-be-detected image of a to-be-detected garbage barrel mouth area, and determines a to-be-detected sample entropy value according to the to-be-detected image, and then performs full barrel detection on the to-be-detected garbage barrel according to the full barrel entropy threshold value and the to-be-detected sample entropy value. Compared with the prior art, a large number of labeled samples of garbage barrel mouths are obtained through deep learning, which leads to overfitting during model training, low garbage barrel full barrel detection efficiency, and inaccurate detection results. However, the application determines the full barrel entropy threshold value and the to-be-detected sample entropy value, and then performs full barrel detection according to the full barrel entropy threshold value and the to-be-detected sample entropy value, thereby improving the detection efficiency of the garbage barrel full barrel, and further improving the accuracy of detecting the garbage barrel full barrel. BRIEF DESCRIPTION OF DRAWINGS
[0073] Figure 1 is a structural schematic diagram of a garbage full barrel detection device of a hardware running environment related to an embodiment scheme of the application;
[0074] Figure 2 is a flowchart of a garbage full barrel detection method first embodiment of the application;
[0075] Figure 3 is a sample entropy normal distribution function fitting curve diagram of the garbage full barrel detection method first embodiment of the application;
[0076] Figure 4 is a pixel distribution asymmetric bivariate Gaussian function fitting curve of the garbage full barrel detection method first embodiment of the application;
[0077] Figure 5 is a flowchart of a garbage full barrel detection method second embodiment of the application;
[0078] Figure 6 is a structural block diagram of a garbage full barrel detection device first embodiment of the application.
[0079] The implementation of the object, functional features and advantages of the application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0080] It should be understood that the specific embodiments described herein are only used to explain the application, and are not used to limit the application.
[0081] Reference Figure 1 ,Figure 1 A garbage full detection device structure schematic diagram of a hardware running environment involved in an embodiment of the present application.
[0082] As Figure 1 shown, the garbage full detection device can include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between the components. The user interface 1003 can include a display, an input unit such as a keyboard, and can also include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 can be a high-speed random access memory (RAM) memory, or a stable non-volatile memory (NVM), such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0083] Those skilled in the art can understand that Figure 1 the structure shown in the above does not constitute a limitation on the garbage full detection device, and can include more or fewer components than the diagram, or combine certain components, or different component arrangements.
[0084] As Figure 1 shown, the memory 1005 as a storage medium can include an operating system, a data storage module, a network communication module, a user interface module, and a garbage full detection program.
[0085] In Figure 1 the garbage full detection device shown, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the garbage full detection device of the present application can be arranged in the garbage full detection device, and the garbage full detection device calls the garbage full detection program stored in the memory 1005 through the processor 1001, and executes the garbage full detection method provided by the embodiment of the present application.
[0086] The embodiment of the present application provides a garbage full detection method, which refers to Figure 2 , Figure 2 a flowchart of a first embodiment of the garbage full detection method of the present application.
[0087] In the embodiment, the garbage full bin detection method comprises the following steps:
[0088] Step S10: Obtain sample information entropy of a sample garbage bin mouth area, and fit the sample information entropy according to a standard normal distribution function to obtain a full bin entropy threshold.
[0089] It is easy to understand that the execution subject of the embodiment can be a garbage full bin detection device with functions of image processing, data processing, network communication and program running, or other computer devices with similar functions, and the embodiment is not limited thereto.
[0090] It can be understood that the sample garbage bin mouth area can be a sample garbage bin image collected by a camera, and then a corresponding sample garbage bin mouth area image is cut according to the garbage bin image, etc., wherein the sample garbage bin can be several samples of three types of empty bin, half-full bin and full bin, wherein in the embodiment, empty bin, half-full bin and full bin samples are required to be selected for calculation, the number of empty bin and half-full bin samples is considerable, and the number of full bin samples is selected to be less, so as to increase the deviation and variance of the full bin sample entropy value, and facilitate the user to identify the full bin sample entropy domain value faster, the number ratio of the three types of empty bin, half-full bin and full bin samples is about 2:2:1 or 3:3:1, so at least 5 samples are collected, and more samples can be collected to reflect different scenes, and generally no more than 20 samples are required.
[0091] For any other garbage bin, if it is similar to the garbage bin color and light condition, the sample can not be selected repeatedly. The sample of the user can also be selected according to the above method, and the embodiment is not limited thereto.
[0092] The way of calibrating the garbage bin mouth area through the collected sample garbage bin image can be that a quadrilateral is used to calibrate each garbage bin mouth area of the drop point. When calibrating, the garbage bin mouth should be completely covered, and a little excess amount should be added, the calibration areas of adjacent garbage bins can be overlapped, the pixel coordinates of the calibration area vertices are obtained, and the selected garbage bin can be recorded as i, then the pixel coordinates of the upper left corner and the lower right corner of the i-th garbage bin are P ij , j = 1, 2, 3, 4. i can be 1, …, N, N is the total number of garbage bins, etc.
[0093] It also needs to be noted that the processing method of obtaining the sample information entropy of the sample garbage bin mouth area is to obtain a sample garbage bin mouth area image, and to perform gray processing on the sample garbage bin mouth area image to obtain a sample gray image, then to determine a unary gray entropy according to the sample gray image, and to process the unary gray entropy to obtain the sample information entropy of the sample garbage bin mouth area, etc.
[0094] The manner of determining the unary gray entropy according to the sample gray image can be: obtaining a plurality of sample gray values according to the sample gray image, then determining the number of pixel points corresponding to each sample gray value and the total number of pixels, and obtaining the unary gray entropy according to each sample gray value, the number of pixel points corresponding to each sample gray value, and the total number of pixels.
[0095] Further, in order to more accurately obtain the unary gray entropy, the step of obtaining the unary gray entropy according to each sample gray value, the number of pixel points corresponding to each sample gray value, and the total number of pixels is: calculating the unary gray entropy through a preset gray entropy formula according to each sample gray value, the number of pixel points corresponding to each sample gray value, and the total number of pixels.
[0096] The preset gray entropy formula is:
[0097]
[0098] In the formula, C ijk is the number of pixel points with a gray value of k in the jth sample gray image of the sample garbage can i, C ij* is the total number of pixels, H ij is the unary gray entropy.
[0099] Suppose that the garbage can i has M samples, the step of processing the unary gray entropy to obtain the sample information entropy of the mouth area of the sample garbage can can also be: determining the sample mean and the sample standard deviation value according to the sample number corresponding to the image of the mouth area of the sample garbage can and the unary gray entropy, and normalizing the unary gray entropy according to the sample mean and the sample standard deviation value to obtain a sample normalized entropy value, and taking the sample normalized entropy value as the sample information entropy of the mouth area of the sample garbage can.
[0100] It can be understood that the sample mean is determined according to the sample number corresponding to the image of the mouth area of the sample garbage can and the unary gray entropy, and the sample standard deviation value is determined according to the sample number corresponding to the image of the mouth area of the sample garbage can, the unary gray entropy, and the sample mean.
[0101] The sample mean is calculated through a preset average formula according to the sample number corresponding to the image of the mouth area of the sample garbage can and the unary gray entropy.
[0102] The preset average formula is:
[0103]
[0104] In the formula, M is the sample number corresponding to the image of the mouth area of the sample garbage can, H i is the sample mean.
[0105] According to the sample quantity corresponding to the sample garbage can mouth area image, the unary gray entropy and the sample mean, the sample standard deviation value is calculated through a preset standard deviation formula;
[0106] The preset standard deviation formula is:
[0107]
[0108] In the formula, σ i is the sample standard deviation value.
[0109] The unary gray entropy, the sample mean and the sample standard deviation are standardized through a preset standardization formula, and the sample target entropy value is obtained.
[0110] The preset standardization formula is:
[0111]
[0112] In the formula, H' ij is the sample target entropy value.
[0113] According to the standard normal distribution function, the sample information entropy is fitted, and the processing mode of the full barrel entropy threshold value can be that the sample entropy after standardization, i.e. the sample target entropy value, is fitted by using the standard normal distribution function. It is assumed that five samples of the same garbage can are selected, including two empty barrels, two half-full barrels and one full barrel. Then, the sample target entropy value is fitted by using the standard normal distribution function to generate a sample entropy normal distribution function fitting curve. Referring to Figure 3 , Figure 3 is the sample entropy normal distribution function fitting curve of the first embodiment of the garbage full barrel detection method of the application. As shown in the figure, the left two points correspond to empty barrels, the middle two points correspond to half-full barrels, and the right point corresponds to a full barrel.
[0114] Figure 3 The curve segment between the rightmost half-full barrel point and the leftmost full barrel point is selected, and a point is selected such that it has a proper distance from the two points in the y-axis direction. The x-axis coordinate of the point is taken as the entropy judgment threshold of the full barrel, i.e. the full barrel entropy threshold value.
[0115] Step S20: acquiring a to-be-detected image of the mouth area of a to-be-detected garbage can, and determining a to-be-detected sample entropy value according to the to-be-detected image.
[0116] It should be noted that the processing mode of determining the to-be-detected sample entropy value according to the to-be-detected image is that the to-be-detected image is subjected to gray processing to obtain a to-be-detected gray image. Then, the pixel value corresponding to the to-be-detected gray image is acquired, and the pixel value is subjected to normalization processing to obtain a target pixel value. Finally, the to-be-detected sample entropy value is determined according to the target pixel value.
[0117] The step of determining the sample entropy value to be detected according to the target pixel value is that the target pixel value is fitted according to an asymmetric bimodal Gaussian function to obtain a pixel distribution curve, then the target standardization entropy value of the image to be detected is determined according to the pixel distribution curve, and the target standardization entropy value is taken as the sample entropy value to be detected.
[0118] The manner of determining the target standardization entropy value of the image to be detected according to the pixel distribution curve is that the first Gaussian peak value and the second Gaussian peak value are determined according to the pixel distribution curve, it is judged whether the first Gaussian peak value and the second Gaussian peak value satisfy a preset peak condition, when the first Gaussian peak value and the second Gaussian peak value satisfy the preset peak condition, the target standardization entropy value of the image to be detected is determined according to the first Gaussian peak value and the second Gaussian peak value, wherein the preset peak condition can be whether the ratio between the first Gaussian peak value and the second Gaussian peak value is greater than a preset peak threshold, the preset peak threshold can be user-defined, can be 2, can be 3, and the embodiment is not limited thereto.
[0119] Suppose that the garbage disposal frequency of residents is analyzed, 7:00-9:00, 11:00-13:00 and 18:00-20:00 are set as high-frequency disposal periods, and the rest of the time is set as a low-frequency disposal period. For the high-frequency disposal period, sample sampling is performed on the monitoring video at an interval T, and the sampling interval of the low-frequency disposal period is 2T-3T, so as to reduce the working burden of the system. Wherein, T can be set to 10-15 minutes, etc.
[0120] Let be the number of pixel points with a gray value of k in the jth sample gray image of the garbage can i to be detected, be the distribution of all pixel values, be After normalization, the element value less than is removed, and the pixel value distribution after is recommended 0.02-0.03. The pixel distribution is fitted by selecting an asymmetric bimodal Gaussian function to obtain a pixel distribution curve of the asymmetric bimodal Gaussian function of the pixel distribution. Referring to Figure 4 , Figure 4 is the pixel distribution curve of the asymmetric bimodal Gaussian function fitting curve of the first embodiment of the garbage full can detection method of the application.
[0121] Let the mean distance be the mean, left variance, right variance and peak value of the closer Gaussian function, f1, the mean, left variance, right variance and peak value of the farther Gaussian function are μ2, wherein, is the gray value of the garbage can i itself. If the following condition is met:
[0122] and
[0123] If yes, it is determined that there is a single-color garbage bag full barrel, and the normalized entropy value of the sample to be detected is set as the maximum value, that is, If no, it is determined that there is no single-color garbage bag full barrel, and then an image of a barrel mouth area of a garbage barrel to be detected is obtained, and the image of the barrel mouth area of the garbage barrel to be detected is subjected to grayscale processing to obtain a grayscale image to be detected, then a one-dimensional grayscale entropy to be detected is determined according to the grayscale image to be detected, the one-dimensional grayscale entropy to be detected is processed to obtain a sample entropy value of the barrel mouth area of the garbage barrel to be detected, and finally, the garbage barrel to be detected is subjected to full barrel detection according to a full barrel entropy threshold value and the sample entropy value to be detected.
[0124] The manner of determining the one-dimensional grayscale entropy to be detected according to the grayscale image to be detected can be that a plurality of grayscale values to be detected are obtained according to the sample grayscale image, then the number of pixel points corresponding to each grayscale value to be detected and the total number of pixels are determined, and the one-dimensional grayscale entropy to be detected is obtained according to each grayscale value to be detected, the number of pixel points corresponding to each grayscale value to be detected, and the total number of pixels. and the like.
[0125] The step of processing the one-dimensional grayscale entropy to be detected to obtain the information entropy to be detected of the barrel mouth area of the garbage barrel to be detected can also be that a mean value to be detected and a standard deviation value to be detected are determined according to the number of samples to be detected corresponding to the image of the barrel mouth area of the garbage barrel to be detected and the one-dimensional grayscale entropy to be detected, and the one-dimensional grayscale entropy to be detected is subjected to standardized processing according to the mean value to be detected and the standard deviation value to be detected to obtain a normalized entropy value to be detected, that is, a sample entropy value to be detected.
[0126] The sample entropy value to be detected is obtained by standardized processing of all the one-dimensional grayscale entropy to be detected, the mean value to be detected, and the standard deviation value to be detected through a preset standardized formula.
[0127] The preset standardized formula is:
[0128]
[0129] In the formula, the sample entropy value to be detected, the one-dimensional grayscale entropy to be detected, the mean value to be detected, and the standard deviation value to be detected.
[0130] Step S30: full barrel detection is performed on the garbage barrel to be detected according to the full barrel entropy threshold value and the sample entropy value to be detected.
[0131] Suppose If yes, it is determined that the garbage barrel i is full. If all the garbage barrels i have If the determination result is that all the garbage cans at the garbage disposal point are full, the garbage can fullness alarm is triggered.
[0132] Further, after the step of detecting the to-be-detected garbage can for fullness according to the fullness entropy threshold and the to-be-detected sample entropy value, when it is detected that the to-be-detected garbage can is full, the garbage fullness prompt information is displayed.
[0133] In a specific implementation, the garbage can fullness alarm can be triggered when a certain number of garbage cans are full, for example, 80% of the total number of garbage cans, so that the cleaner can clean in time.
[0134] In the embodiment, first, the sample information entropy of the sample garbage can mouth area is obtained, and the sample information entropy is fitted according to the standard normal distribution function to obtain the fullness entropy threshold. Then, the to-be-detected image of the to-be-detected garbage can mouth area is obtained, and the to-be-detected sample entropy value is determined according to the to-be-detected image. After that, the to-be-detected garbage can is detected for fullness according to the fullness entropy threshold and the to-be-detected sample entropy value. Compared with the prior art, a large number of labeled samples of garbage can mouths are obtained through deep learning, otherwise the model may be over-fitted during training. In the embodiment, the fullness entropy threshold and the to-be-detected sample entropy value are determined, and then the to-be-detected garbage can is detected for fullness according to the fullness entropy threshold and the to-be-detected sample entropy value, so that a simple and convenient detection method is used to detect for fullness.
[0135] Reference Figure 5 , Figure 5 The figure is a flowchart of the garbage fullness detection method according to the second embodiment of the present application.
[0136] Based on the first embodiment, in the embodiment, the step S10 further includes:
[0137] Step S101: Obtain the sample garbage can mouth area image, and perform gray scale processing on the sample garbage can mouth area image to obtain a sample gray scale image.
[0138] It can be understood that the sample garbage can mouth area can be a sample garbage can image collected by a camera, and then the corresponding sample garbage can mouth area image is cut from the garbage can image, etc. The sample garbage cans can be several samples of three types of empty cans, half-full cans and full cans. In the embodiment, empty cans, half-full cans and full cans are selected for training. The number of empty cans and half-full cans is equivalent, and the number of full cans is selected to be less, so as to increase the deviation and variance of the full can sample entropy value, and facilitate the user to quickly identify the full can sample entropy domain value. The number ratio of the three types of samples is about 2:2:1 or 3:3:1, so at least 5 samples are collected, and more samples can be collected to reflect different scenarios, and generally no more than 20 samples are needed.
[0139] For any other garbage can, if it is similar to the garbage can color, lighting conditions, it can not need to repeat the selection of samples. It can also select your own samples according to the above method, etc. The present embodiment is not limited.
[0140] The way of calibrating the garbage can mouth area through the collected sample garbage can image can be that a quadrilateral is used to calibrate each garbage can mouth area of the drop point. When calibrating, the garbage can mouth should be completely covered, and a little excess should be added. The calibration areas of adjacent garbage cans can overlap, and the pixel coordinates of the calibration area vertices are obtained. The selected garbage can can be recorded as i, and the pixel coordinates of the upper left corner and the lower right corner of the ith garbage can are P ij , j = 1, 2, 3, 4. i can be 1,..., N, N is the total number of garbage cans, etc.
[0141] It should be noted that the image processing software can be used to perform gray processing on the multiple sample garbage can mouth area images to obtain sample gray images, etc.
[0142] Step S102: determining a unary gray entropy according to the sample gray image.
[0143] The way of determining a unary gray entropy according to the sample gray image can be that a plurality of sample gray values are obtained according to the sample gray image, then the number of pixel points corresponding to each sample gray value and the total number of pixels are determined, and the unary gray entropy is obtained according to each sample gray value, the number of pixel points corresponding to each sample gray value, and the total number of pixels, etc.
[0144] Further, in order to more accurately obtain the unary gray entropy, the step of obtaining the unary gray entropy according to each sample gray value, the number of pixel points corresponding to each sample gray value, and the total number of pixels is that the unary gray entropy is calculated through a preset gray entropy formula according to each sample gray value, the number of pixel points corresponding to each sample gray value, and the total number of pixels.
[0145] The preset gray entropy formula is:
[0146]
[0147] In the formula, C ijk is the number of pixel points with a gray value of k in the jth sample gray image of the sample garbage can i, C ij* is the total number of pixels, H ij is the unary gray entropy.
[0148] Step S103: processing the unary gray entropy to obtain the sample information entropy of the sample garbage can mouth area, and fitting the sample information entropy according to the standard normal distribution function to obtain the full can entropy threshold.
[0149] It can be understood that the sample mean is determined according to the sample quantity corresponding to the sample garbage can mouth area image and the unary gray entropy, and the sample standard deviation value is determined according to the sample quantity corresponding to the sample garbage can mouth area image, the unary gray entropy and the sample mean.
[0150] It can be understood that the sample mean is determined according to the sample quantity corresponding to the sample garbage can mouth area image and the unary gray entropy, and the sample standard deviation value is determined according to the sample quantity corresponding to the sample garbage can mouth area image, the unary gray entropy and the sample mean.
[0151] The sample mean is calculated according to the sample quantity corresponding to the sample garbage can mouth area image and the unary gray entropy through a preset average formula.
[0152] The preset average formula is:
[0153]
[0154] In the formula, M is the sample quantity corresponding to the sample garbage can mouth area image, H i is the sample mean.
[0155] The sample standard deviation value is calculated according to the sample quantity corresponding to the sample garbage can mouth area image, the unary gray entropy and the sample mean through a preset standard deviation formula.
[0156] The preset standard deviation formula is:
[0157]
[0158] In the formula, σ i is the sample standard deviation value.
[0159] All unary gray entropies, sample means and sample standard deviations are standardized through a preset standardization formula to obtain sample target entropy values.
[0160] The preset standardization formula is:
[0161]
[0162] In the formula, H' ij is the sample target entropy value.
[0163] The processing manner of obtaining the full barrel entropy threshold value according to the fitting of the sample information entropy based on the standard normal distribution function can be that the sample entropy after standardization, that is, the sample target entropy value, is fitted by using the standard normal distribution function, five samples of the same garbage can are selected, including two empty barrels, two half-full barrels and one full barrel, then the sample target entropy value is fitted by using the standard normal distribution function to generate a sample entropy normal distribution function fitting curve, and the sample entropy normal distribution function fitting curve of the first embodiment of the garbage full barrel detection method of the present application is referred to as Figure 3 , Figure 3 As shown in the figure, the left two points correspond to empty barrels, the middle two points correspond to half-full barrels, and the right point corresponds to a full barrel.
[0164] Figure 3 The curve segment between the rightmost half-full barrel point and the leftmost full barrel point, an arbitrary point is selected to have a proper distance from the two points in the y-axis direction, and the x-axis coordinate of the point is taken as the entropy judgment threshold value of the full barrel, that is, the full barrel entropy threshold value.
[0165] In the embodiment, first, a sample garbage can mouth area image is obtained, and the sample garbage can mouth area image is subjected to gray scale processing to obtain a sample gray scale image, then a unary gray scale entropy is determined according to the sample gray scale image, and finally the unary gray scale entropy is processed to obtain a sample information entropy of the sample garbage can mouth area, so that the sample information entropy of the sample garbage can mouth area can be accurately obtained.
[0166] Referring to Figure 6 , Figure 6 The structure block diagram of the first embodiment of the garbage full barrel detection device of the present application is shown in FIG. 6.
[0167] As shown in Figure 6 , the garbage full barrel detection device provided by the embodiment of the present application comprises:
[0168] The acquisition module 6001 is configured to acquire a sample information entropy of a sample garbage can mouth area, and fit the sample information entropy according to a standard normal distribution function to obtain a full barrel entropy threshold value;
[0169] The determination module 6002 is configured to acquire a to-be-detected image of a to-be-detected garbage can mouth area, and determine a to-be-detected sample entropy value according to the to-be-detected image;
[0170] The detection module 6003 is configured to perform full barrel detection on the to-be-detected garbage can according to the full barrel entropy threshold value and the to-be-detected sample entropy value.
[0171] In the embodiment, first, sample information entropy of a sample garbage can mouth area is acquired, and the sample information entropy is fitted according to a standard normal distribution function to obtain a full can entropy threshold value; then, a to-be-detected image of a to-be-detected garbage can mouth area is acquired, and a to-be-detected sample entropy value is determined according to the to-be-detected image; and then, the to-be-detected garbage can is detected according to the full can entropy threshold value and the to-be-detected sample entropy value. Compared with the prior art, a large number of labeled samples of garbage can mouths are obtained through deep learning, which leads to overfitting of the model during training, low efficiency of garbage can fullness detection, and inaccurate detection results. In the embodiment, the full can entropy threshold value and the to-be-detected sample entropy value are determined, and then the full can is detected according to the full can entropy threshold value and the to-be-detected sample entropy value, so that the detection efficiency of the full can of the garbage can is improved, and the accuracy of detecting the full can of the garbage can is improved.
[0172] Further, the acquisition module 6001 is further configured to acquire a sample garbage can mouth area image, and perform grayscale processing on the sample garbage can mouth area image to obtain a sample grayscale image.
[0173] The acquisition module 6001 is further configured to determine a one-dimensional grayscale entropy according to the sample grayscale image.
[0174] The acquisition module 6001 is further configured to process the one-dimensional grayscale entropy to obtain a sample information entropy of the sample garbage can mouth area.
[0175] Further, the acquisition module 6001 is further configured to obtain a plurality of sample grayscale values according to the sample grayscale image.
[0176] The acquisition module 6001 is further configured to determine the number of pixel points corresponding to each sample grayscale value and the total number of pixels.
[0177] The acquisition module 6001 is further configured to obtain a one-dimensional grayscale entropy according to each sample grayscale value, the number of pixel points corresponding to each sample grayscale value, and the total number of pixels.
[0178] Further, the acquisition module 6001 is further configured to calculate the one-dimensional grayscale entropy according to each sample grayscale value, the number of pixel points corresponding to each sample grayscale value, and the total number of pixels through a preset grayscale entropy formula.
[0179] The preset grayscale entropy formula is:
[0180]
[0181] In the formula, C ijk is the number of pixel points with a grayscale value of k in the jth sample grayscale image of the sample garbage can i, C ij* is the total number of pixels, H ij is the one-dimensional grayscale entropy.
[0182] Further, the acquisition module 6001 is further used for determining a sample mean value according to the sample quantity corresponding to the sample garbage can opening area image and the unary gray entropy;
[0183] The acquisition module 6001 is further used for performing standardization processing on the unary gray entropy according to the sample mean value and the sample standard deviation value, obtaining a sample standardization entropy value, and taking the sample standardization entropy value as a sample information entropy of the sample garbage can opening area.
[0184] Further, the acquisition module 6001 is further used for determining a sample mean value according to the sample quantity corresponding to the sample garbage can opening area image and the unary gray entropy;
[0185] The acquisition module 6001 is further used for determining a sample standard deviation value according to the sample quantity corresponding to the sample garbage can opening area image, the unary gray entropy and the sample mean value.
[0186] Further, the acquisition module 6001 is further used for calculating a sample mean value according to the sample quantity corresponding to the sample garbage can opening area image and the unary gray entropy through a preset mean formula;
[0187] The preset mean formula is:
[0188]
[0189] In the formula, M is the sample quantity corresponding to the sample garbage can opening area image, H i is the sample mean value.
[0190] Further, the acquisition module 6001 is further used for calculating a sample standard deviation value according to the sample quantity corresponding to the sample garbage can opening area image, the unary gray entropy and the sample mean value through a preset standard deviation formula;
[0191] The preset standard deviation formula is:
[0192]
[0193] In the formula, σ i is the sample standard deviation value.
[0194] Further, the determination module 6002 is further used for performing gray processing on the to-be-detected image to obtain a to-be-detected gray image;
[0195] The determination module 6002 is further used for acquiring a pixel value corresponding to the to-be-detected gray image, and performing normalization processing on the pixel value to obtain a target pixel value;
[0196] The determination module 6002 is further configured to determine a sample entropy value to be detected according to the target pixel value.
[0197] Further, the determination module 6002 is further configured to fit the target pixel value according to an asymmetric bivariate Gaussian function, to obtain a pixel distribution curve;
[0198] The determination module 6002 is further configured to determine a target normalized entropy value of the image to be detected according to the pixel distribution curve, and take the target normalized entropy value as the sample entropy value to be detected.
[0199] Further, the determination module 6002 is further configured to determine a first Gaussian peak value and a second Gaussian peak value according to the pixel distribution curve.
[0200] The determination module 6002 is further configured to determine whether the first Gaussian peak value and the second Gaussian peak value satisfy a preset peak condition.
[0201] The determination module 6002 is further configured to determine a target normalized entropy value of the image to be detected according to the first Gaussian peak value and the second Gaussian peak value when the first Gaussian peak value and the second Gaussian peak value satisfy the preset peak condition.
[0202] Further, the detection module 6003 is further configured to display a full garbage can prompt information when it is detected that the garbage can to be detected is full.
[0203] Other embodiments or specific implementations of the garbage full detection device can refer to the above-mentioned method embodiments, and will not be described here.
[0204] It should be noted that in this paper, the term "include", "contain" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or system including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or system. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or system including the element.
[0205] The above-mentioned embodiment number of the application is only for description, not representing the advantages and disadvantages of the embodiments.
[0206] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned example method can be realized by means of software and a necessary general hardware platform, and of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk) and includes a number of instructions for causing an end device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method described in each embodiment of the present application.
[0207] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent flow transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A full bin detection method, characterized by, The garbage full bin detection method comprises: Obtaining sample information entropy of a sample garbage bin mouth area, and fitting the sample information entropy according to a standard normal distribution function to obtain a full bin entropy threshold; Obtaining a to-be-detected image of a to-be-detected garbage bin mouth area, and determining a to-be-detected sample entropy value according to the to-be-detected image; According to the full bin entropy threshold and the to-be-detected sample entropy value, full bin detection is performed on the to-be-detected garbage bin.
2. The method of claim 1, wherein, The step of obtaining the sample information entropy of the sample garbage bin mouth area comprises: Obtaining a sample garbage bin mouth area image, and performing grayscale processing on the sample garbage bin mouth area image to obtain a sample grayscale image; Determining a unary grayscale entropy according to the sample grayscale image; Processing the unary grayscale entropy to obtain the sample information entropy of the sample garbage bin mouth area.
3. The method of claim 2, wherein, The step of determining the unary grayscale entropy according to the sample grayscale image comprises: Obtaining a plurality of sample grayscale values according to the sample grayscale image; Determining the number of pixel points corresponding to each sample grayscale value and the total number of pixels; Obtaining a unary grayscale entropy according to each sample grayscale value, the number of pixel points corresponding to each sample grayscale value, and the total number of pixels.
4. The method of claim 3, wherein, The step of obtaining the unary grayscale entropy according to each sample grayscale value, the number of pixel points corresponding to each sample grayscale value, and the total number of pixels comprises: According to each sample grayscale value, the number of pixel points corresponding to each sample grayscale value, and the total number of pixels, the unary grayscale entropy is calculated through a preset grayscale entropy formula; The preset grayscale entropy formula is: In the formula, C ijk The number of pixel points with a gray value of k in the jth sample gray image of the sample garbage can i, C ij* The total number of pixels, H ij The unary gray entropy.
5. The method of claim 4, wherein, The step of processing the unary grayscale entropy to obtain the sample information entropy of the sample garbage bin mouth area comprises: Determining a sample mean value and a sample standard deviation value according to the number of samples corresponding to the sample garbage bin mouth area image and the unary grayscale entropy; According to the sample mean value and the sample standard deviation value, the unary grayscale entropy is standardized to obtain a sample standardized entropy value, and the sample standardized entropy value is taken as the sample information entropy of the sample garbage bin mouth area.
6. The method of claim 5, wherein, The step of determining the sample mean value and the sample standard deviation value according to the number of samples corresponding to the sample garbage bin mouth area image and the unary grayscale entropy comprises: Determining the sample mean value according to the number of samples corresponding to the sample garbage bin mouth area image and the unary grayscale entropy; Determining the sample standard deviation value according to the number of samples corresponding to the sample garbage bin mouth area image, the unary grayscale entropy, and the sample mean value.
7. The method of claim 6, wherein, The step of calculating the sample mean value according to the number of samples corresponding to the sample garbage bin mouth area image and the unary grayscale entropy through a preset average formula comprises: According to the number of samples corresponding to the sample garbage bin mouth area image and the unary grayscale entropy, the sample mean value is calculated through a preset average formula; The preset average formula is: In the formula, M is the sample quantity corresponding to the sample garbage can mouth area image, H i is the sample mean.
8. The method of claim 7, wherein, The step of determining the sample standard deviation value according to the number of samples corresponding to the sample garbage bin mouth area image, the unary grayscale entropy, and the sample mean value comprises: According to the number of samples corresponding to the sample garbage bin mouth area image, the unary grayscale entropy, and the sample mean value, the sample standard deviation value is calculated through a preset standard deviation formula; The preset standard deviation formula is: In the formula, σ i is the sample standard deviation.
9. The method according to any one of claims 1 to 8, wherein, The step of determining the sample entropy value to be detected according to the image to be detected comprises: performing gray processing on the image to be detected to obtain a gray image to be detected; acquiring pixel values corresponding to the gray image to be detected, and performing normalization processing on the pixel values to obtain target pixel values; determining the sample entropy value to be detected according to the target pixel values.
10. The method of claim 9, wherein, The step of determining the sample entropy value to be detected according to the target pixel values comprises: fitting the target pixel values according to an asymmetric double Gaussian function to obtain a pixel distribution curve; determining a target normalized entropy value of the image to be detected according to the pixel distribution curve, and taking the target normalized entropy value as the sample entropy value to be detected.
11. The method of claim 10, wherein, The step of determining the target normalized entropy value of the image to be detected according to the pixel distribution curve comprises: determining a first Gaussian peak value and a second Gaussian peak value according to the pixel distribution curve; judging whether the first Gaussian peak value and the second Gaussian peak value satisfy a preset peak condition; when the first Gaussian peak value and the second Gaussian peak value satisfy the preset peak condition, determining the target normalized entropy value of the image to be detected according to the first Gaussian peak value and the second Gaussian peak value.
12. The method of claim 1, wherein, After the step of performing full-barrel detection on the garbage can to be detected according to the full-barrel entropy threshold value and the sample entropy value to be detected, the method further comprises: when it is detected that the garbage can to be detected is full, displaying a full-barrel prompt information.
13. A full bin detection apparatus, characterised in that, The garbage full-barrel detection device comprises: an acquisition module, configured to acquire a sample information entropy of a barrel mouth area of a sample garbage can, and fit the sample information entropy according to a standard normal distribution function to obtain a full-barrel entropy threshold value; a determination module, configured to acquire an image to be detected of a barrel mouth area of a garbage can to be detected, and determine a sample entropy value to be detected according to the image to be detected; a detection module, configured to perform full-barrel detection on the garbage can to be detected according to the full-barrel entropy threshold value and the sample entropy value to be detected.
14. The apparatus of claim 13, wherein, The acquisition module is further configured to acquire an image of a barrel mouth area of a sample garbage can, and perform gray processing on the image of the barrel mouth area of the sample garbage can to obtain a sample gray image. The acquisition module is further configured to determine a one-dimensional gray entropy according to the sample gray image. The acquisition module is further configured to process the one-dimensional gray entropy to obtain the sample information entropy of the barrel mouth area of the sample garbage can.
15. The apparatus of claim 14, wherein, The acquisition module is further configured to acquire a plurality of sample gray values according to the sample gray image. The acquisition module is further configured to determine a number of pixel points corresponding to each sample gray value and a total number of pixels. The acquisition module is further configured to acquire a one-dimensional gray entropy according to each sample gray value, the number of pixel points corresponding to each sample gray value, and the total number of pixels.
16. The apparatus of claim 15, wherein, The acquisition module is further configured to calculate the one-dimensional gray entropy according to each sample gray value, the number of pixel points corresponding to each sample gray value, and the total number of pixels through a preset gray entropy formula. The preset gray entropy formula is: In the formula, C ijk The number of pixel points with a gray value of k in the jth sample gray image of the sample garbage can i, C ij* The total number of pixels, H ij The unary gray entropy.
17. The apparatus of claim 16, wherein, The acquisition module is further configured to determine a sample mean value and a sample standard deviation value according to a sample quantity corresponding to the image of the barrel mouth area of the sample garbage can and the one-dimensional gray entropy. The acquisition module is further configured to perform standardization processing on the unary gray entropy according to the sample mean and the sample standard deviation value, to obtain a sample standardization entropy value, and to take the sample standardization entropy value as a sample information entropy of a sample garbage can spout area.
18. The apparatus of claim 17, wherein, The acquisition module is further configured to determine a sample mean according to the sample quantity corresponding to the sample garbage can spout area image and the unary gray entropy. The acquisition module is further configured to determine a sample standard deviation value according to the sample quantity corresponding to the sample garbage can spout area image, the unary gray entropy, and the sample mean.
19. A full bin detection apparatus, characterised in that, The device comprises a memory, a processor, and a garbage full can detection program stored on the memory and executable on the processor, and the garbage full can detection program is configured to implement the steps of the garbage full can detection method according to any one of claims 1-12.
20. A storage medium, characterized by The storage medium has a garbage full can detection program stored thereon, and the garbage full can detection program, when executed by a processor, implements the steps of the garbage full can detection method according to any one of claims 1-12.
Citation Information
Patent Citations
Intelligent management system for garbage classified discharge
CN110647854A
Garbage classification treatment method and related products
CN110991271A