A garbage bin classification supervision method
By calculating importance according to the frequency and frequency differences of grayscale values in the garbage monitoring video, setting and correcting the limiting contrast parameters, the problem of poor garbage enhancement effect in the existing technology is solved, and the accuracy of garbage category identification and classification supervision is improved.
Patent Information
- Application Number
- CN202411135947.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-08-19
AI Technical Summary
In the prior art, unreasonable setting of restricted contrast parameters leads to poor garbage enhancement effect, affecting garbage category identification and classification supervision.
By determining the target area in the monitoring video frame, calculating importance according to the frequency and frequency differences of the grayscale value, filtering important grayscale values and setting limit contrast parameters, correcting parameters to adapt to changes in the grayscale range, and ensuring the enhancement effect of garbage characteristics.
It improves the accuracy of garbage category identification and the accuracy of garbage classification supervision, avoids important grayscale values and new features being swallowed up during the enhancement process, and significantly improves the garbage enhancement effect.
Smart Images

Figure CN118651557B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image enhancement technology and more specifically to a method for monitoring the classification of garbage bins. Background Art
[0002] Garbage classification is a scientific management method for the effective disposal of garbage, which helps to protect the environment, effectively utilize resources, and promote sustainable social development. In order to achieve garbage classification supervision, surveillance cameras are usually set up around the garbage bins to monitor garbage classification by identifying whether the category of garbage in the surveillance video is consistent with the category of the garbage bin. However, the details of the garbage in the surveillance video are not clear, which affects the identification of the garbage category, so it is necessary to enhance the garbage area in the surveillance video.
[0003] The patent application document with publication number "CN114463208A" discloses a method for enhancing the image of a built-in surveillance video based on a contrast-limited adaptive histogram equalization method, comprising an image acquisition step, an image preprocessing step, an image enhancement step and an image post-processing step; the image acquisition step is to read the surveillance image and convert it into a preprocessed image of a specified format; the image preprocessing step is to scale the preprocessed image to a specified size as an input image; the image enhancement step is to convert the format of the input image into a specified mode; according to the mode, a contrast-limited adaptive histogram equalization method is applied to one or more channels of the input image to obtain an enhanced image; the image post-processing step is to determine whether to perform grayscale conversion on the enhanced image according to a user preset instruction, and output the preprocessed image and the enhanced image.
[0004] The limited contrast adaptive histogram equalization method adopted in the above patent application documents can enhance the garbage area in the surveillance video. The limited contrast adaptive histogram equalization method can prevent the grayscale values with lower frequencies from being swallowed up during enhancement. However, the limited contrast parameters of the limited contrast adaptive histogram equalization method are usually set manually. When the limited contrast parameter is set too large, the effect of preventing the grayscale values from being swallowed up cannot be achieved. When the limited contrast parameter is set too small, the enhancement effect cannot be achieved, which will result in poor garbage enhancement effect, affect the identification of garbage categories, and thus affect garbage classification supervision.
[0005] The patent application document with the announcement number "CN117952974B" discloses an image processing method for organoid identification, which discloses a method for calculating the importance of grayscale values, and setting an enhancement threshold according to the importance for enhancement. The logic of importance in this method is: when the number of pixels corresponding to the same grayscale value in multiple consecutive images increases, the importance of the grayscale value becomes greater, and the grayscale value is subsequently enhanced. However, the change in the frequency of grayscale values in the garbage area that can reflect the main characteristics of the garbage does not conform to the logic of importance in patent CN117952974B. Therefore, when the corresponding importance calculation method in patent CN117952974B is used to enhance the garbage area, the enhancement effect is poor. Summary of the invention
[0006] In order to solve the problem that unreasonable setting of limiting contrast parameters leads to poor enhancement effect of garbage and affects garbage classification supervision, the present invention proposes a garbage bin classification supervision method, which includes the following steps:
[0007] Determine the target area in each frame of the surveillance video, the target area is the area corresponding to the garbage to be disposed; determine the importance of the grayscale value in the target frame according to the frequency of the grayscale value in the target area of the target frame and the frequency difference of the grayscale value in the target area of the target frame and the previous frame, the importance is positively correlated with the frequency and negatively correlated with the frequency difference; select important grayscale values according to their importance, and determine the limit contrast parameter of the target frame according to the frequency of the important grayscale values in the target area of the target frame; determine the grayscale range of the target frame and the previous frame according to the difference in the grayscale range of the target area of the target frame and the previous frame. similarity; in response to the grayscale range similarity being not less than a preset similarity threshold, the target area of the target frame is enhanced using the restricted contrast parameter of the target frame; otherwise, the restricted contrast parameter of the target frame is corrected according to the frequency of the maximum point in the grayscale histogram of the target area of the target frame, the corrected restricted contrast parameter is negatively correlated with the variance of the frequency of the maximum point, and the target area of the target frame is enhanced using the corrected restricted contrast parameter of the target frame; the garbage category is identified according to the enhanced result of the target area of each frame, and it is determined whether the garbage category is consistent with the category of the garbage bin where the corresponding garbage is placed, so as to realize the classification supervision of garbage bins.
[0008] The effect is as follows: the present invention selects important grayscale values through the frequency of grayscale values in the target area of the target frame and the frequency difference of grayscale values in the target area between the target frame and the previous frame, and sets the limiting contrast parameter according to the frequency of the important grayscale values, so that the important grayscale values will not be swallowed up during enhancement, ensuring the enhancement effect of important image features of garbage, making subsequent garbage category identification more accurate, and improving the accuracy of garbage classification supervision; in the process of dumping garbage into a trash can, the garbage that is blocked in the previous frame may be revealed in the next frame, so that there are newly added garbage features in the next frame. The present invention corrects the limiting contrast parameter of the target frame according to the frequency of the maximum point in the grayscale histogram of the target area of the target frame, avoiding the newly added garbage features in the target frame from being swallowed up during enhancement, further improving the garbage enhancement effect, and further improving the accuracy of garbage category identification and the accuracy of garbage classification supervision.
[0009] In one embodiment, determining the target area in each frame of the surveillance video includes: using a semantic segmentation method to identify the area corresponding to the garbage to be disposed in each frame of the surveillance video as the target area of each frame.
[0010] In one embodiment, the importance satisfies the expression: ; In the formula, Indicates Gray value in frame The importance of Take all For every integer in , Indicates the number of frames of the surveillance video; Indicates Grayscale value in the target area of the frame frequency; Indicates The maximum frequency among the frequencies of all gray values in the target area of the frame; Indicates Grayscale value in the target area of the frame frequency; Indicates the absolute value symbol; represents the maximum value function; Represents an exponential function with a natural constant as its base.
[0011] The effect is that the importance takes into account the frequency difference of grayscale values in the target area of the target frame and the previous frame, as well as the frequency of grayscale values in the target area of the target frame. Grayscale values with greater importance are more likely to be important grayscale features of garbage, which can play a key role in the subsequent identification of garbage categories.
[0012] In one embodiment, screening the important grayscale values according to their importance includes: in response to the importance of the grayscale value being greater than a preset importance threshold, taking the grayscale value as the important grayscale value.
[0013] In one embodiment, determining the limiting contrast parameter of the target frame based on the frequency of important grayscale values in the target area of the target frame includes: obtaining the minimum value of the frequency of each important grayscale value of the target frame in the target area of the target frame as the limiting contrast parameter of the target frame.
[0014] The effect is that using the minimum value of the frequency of important grayscale values in the target area of the target frame as a limiting contrast parameter can ensure that important grayscale values will not be swallowed up during enhancement, thereby improving the accuracy of subsequent garbage category recognition and the accuracy of garbage classification supervision.
[0015] In one embodiment, the grayscale range similarity between the target frame and the target region of the previous frame satisfies the expression: ; In the formula, Indicates Similarity of grayscale range of target area between frame and previous frame; Indicates The set of all gray values appearing in the target area of the frame; For the The set of all gray values appearing in the target area of the frame; For collection and The difference of Difference The number of elements in ; For collection The number of elements in ; Represents an exponential function with a natural constant as its base.
[0016] In one embodiment, the modified limiting contrast parameter satisfies the expression: ; In the formula, Indicates Limit contrast parameter after frame correction; Indicates Limit contrast parameter before frame correction; Indicates The grayscale histogram of the target area of the frame The frequency corresponding to the maximum point; Indicates The mean value of the frequencies corresponding to all the maximum points in the grayscale histogram of the target area of the frame; Indicates The number of maximum points in the grayscale histogram of the target area of the frame; Represents an exponential function with a natural constant as its base.
[0017] The effect is that the present invention corrects the limiting contrast parameter of the target frame according to the variance of the frequency of the maximum point in the grayscale histogram of the target area of the target frame. When the variance is larger, the degree of reduction of the limiting contrast parameter is greater, which avoids the newly added garbage features in the target frame being swallowed up during enhancement, and further improves the garbage enhancement effect.
[0018] In one embodiment, identifying the garbage category based on the enhancement results of the target area of each frame includes: inputting the enhancement results of the target area of each frame into a neural network to identify the category of the garbage to be disposed contained in each frame.
[0019] The effect is that the present invention has good enhancement effect, and the garbage category is identified according to the enhancement result of the target area. Compared with directly identifying the garbage category according to the target area, the identification result is more accurate and can improve the accuracy of garbage classification supervision.
[0020] The present invention has the following beneficial effects: the present invention sets a limiting contrast parameter according to the frequency of important grayscale values, so that the important grayscale values will not be swallowed up during enhancement, ensuring the enhancement effect of important image features of garbage, and improving the accuracy of garbage category recognition and the accuracy of garbage classification supervision; the present invention corrects the limiting contrast parameter of the target frame, avoiding the newly added garbage features in the target frame from being swallowed up during enhancement, further improving the enhancement effect of the garbage, and further improving the accuracy of garbage category recognition and the accuracy of garbage classification supervision. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0022] Figure 1 This is a flowchart of the steps of a method for monitoring garbage bin classification according to an embodiment of the present invention;
[0023] Figure 2 For images of trash placement;
[0024] Figure 3 For the target area;
[0025] Figure 4 The result of histogram equalization on the target area;
[0026] Figure 5It is the result of using a larger limited contrast parameter to perform limited contrast adaptive histogram equalization on the target area;
[0027] Figure 6 It is the result of performing contrast-limited adaptive histogram equalization on the target area using a smaller contrast-limited parameter;
[0028] Figure 7 The result of enhancing the target area using the method in patent CN117952974B;
[0029] Figure 8 This is the enhancement result of enhancing the target area using the method of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0031] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0032] See also Figure 1 , which shows a flowchart of a method for classifying and supervising garbage bins provided by an embodiment of the present invention, the method comprising the following steps:
[0033] S001. Collect surveillance videos of garbage disposal and determine the area corresponding to the garbage to be disposed in each frame of the surveillance video as the target area.
[0034] Surveillance cameras are deployed at garbage stations. Since some garbage bags are opaque and affect the identification of garbage categories, people who throw garbage are required to pour the garbage in the garbage bags into the garbage bins of the corresponding categories when throwing garbage. When people pour the garbage in the garbage bags into the garbage bins of the corresponding categories, surveillance cameras record the surveillance video of the process of pouring the garbage into the garbage bins.
[0035] The present invention adopts the semantic segmentation method to identify the area corresponding to the garbage to be placed in each frame of the surveillance video. The specific content of the semantic segmentation network is as follows:
[0036] The input of the semantic segmentation network is each frame of the surveillance video of garbage disposal, and the output is the binary image corresponding to each frame. The grayscale value of the pixel points in the area corresponding to the garbage to be disposed in the binary image is 1, and the grayscale value of the pixel points in the rest of the area is 0; the training set of the semantic segmentation network is the image containing the garbage to be disposed, and the labeling process is: the pixels in the background area of the image are marked as 0, and the pixels in the image belonging to the garbage to be disposed are marked as 1. The loss function of the semantic segmentation network is the cross entropy loss.
[0037] Input each frame of the surveillance video into the trained semantic segmentation network, output the binary image corresponding to each frame, multiply the binary image with the corresponding frame to obtain the area corresponding to the garbage to be placed in each frame. The area corresponding to the garbage to be placed in each frame is used as the target area of each frame, for example Figure 2 A frame of image for throwing garbage, Figure 3 for Figure 2 target area in .
[0038] S002. Determine the importance of the grayscale values in each frame according to the frequency of the grayscale values in the target area of each frame and the frequency difference of the grayscale values in the target area of each frame and the previous frame, select the important grayscale values of each frame according to the importance, and determine the limiting contrast parameter of each frame according to the frequency of the important grayscale values in the target area of each frame.
[0039] It should be noted that the histogram equalization algorithm is a commonly used image enhancement algorithm, but the histogram equalization algorithm may swallow up the grayscale values with lower frequencies in the image, causing the image features corresponding to the grayscale values with lower frequencies to disappear. For example Figure 4 For Figure 3 The result of histogram equalization is: Figure 4 Medium details are not clear and the enhancement effect is poor.
[0040] Contrast-limited adaptive histogram equalization is an image enhancement method based on histogram equalization. It can solve the problem that histogram equalization may produce swallowing phenomenon for gray values with small frequency. Contrast-limited adaptive histogram equalization introduces a contrast-limited parameter, which cuts the part of the histogram with a frequency greater than the contrast-limited parameter and evenly distributes it to all gray values. This can prevent the gray values in the histogram from being swallowed up when being enhanced because the frequency is too small. However, if the contrast-limited parameter is set too large, the effect of avoiding the gray values from being swallowed up cannot be achieved. If the contrast-limited parameter is set too small, the enhancement effect cannot be achieved.
[0041] For example, Figure 5 To use 0.1 as the limiting contrast parameter Figure 3 The result of contrast-limited adaptive histogram equalization. Figure 6For the contrast parameter set to 0.001 Figure 3 The result of contrast-constrained adaptive histogram equalization. Figure 5 The result of histogram equalization (i.e. Figure 4 ) is similar, but the effect of avoiding the gray value being swallowed up is not achieved. Figure 6 Compared with the target area before enhancement (i.e. Figure 3 ) is similar and the enhancement effect is not achieved.
[0042] Therefore, the present invention measures each grayscale value in the target area of each frame, screens out important grayscale values belonging to important image features, and sets limiting contrast parameters according to the frequency of important grayscale values to avoid important grayscale values being swallowed up during enhancement, resulting in the loss of important features of the garbage to be disposed, affecting the subsequent identification of the category of the garbage to be disposed.
[0043] Specifically, the importance of the grayscale value in each frame is determined according to the frequency of the grayscale value in the target area of each frame and the frequency difference of the grayscale value in the target area of each frame and the previous frame:
[0044]
[0045] In the formula, Indicates Gray value in frame The importance of Take all For every integer in , Indicates the number of frames of the surveillance video; Indicates Grayscale value in the target area of the frame frequency; Indicates The maximum frequency among the frequencies of all gray values in the target area of the frame; Indicates Grayscale value in the target area of the frame frequency; Indicates the absolute value symbol; represents the maximum value function; Represents an exponential function with a natural constant as the base. The smaller the frequency difference in the target area of the previous and next frames, the gray value The more stable the distribution of It is more likely to correspond to important image features of the garbage to be disposed. Since the frequency is in the range of [0,1], the frequency difference The value of is always small, so the present invention uses right Proper expansion to prevent The value of is always small, resulting in a small degree of differentiation of the importance of each gray value. This prevents the denominator from being zero.
[0046] When the gray value When corresponding to the noise pixel, the gray value The frequency difference in the target area between the previous and next frames In order to eliminate the interference of noise on the importance calculation, the present invention uses the Grayscale value in the target area of the frame The frequency of Make corrections when Grayscale value in the target area of the frame The larger the frequency, the gray value The stable and important image features that are more likely to be discarded are Grayscale value in the target area of the frame The smaller the frequency, the gray value It is more likely to be noise. Therefore, the present invention will As The index of The more hours, Greater than 1 and larger, then right The greater the reduction of The bigger it is, Greater than 1 and smaller, then right The smaller the reduction, the more the importance depends on the frequency difference .
[0047] Preset importance threshold , the implementer can set it according to the actual implementation situation, for example . The gray value in the target area of the frame whose importance is greater than the importance threshold is taken as the first The important grayscale value of the frame. The minimum value of the frequency of important gray values in the target area of the frame is taken as the Limit contrast parameter of the frame.
[0048] It should be noted that when the minimum value of the frequency of important grayscale values is used as the limiting contrast parameter, the frequencies in the histogram that exceed the minimum value will be clipped. After clipping, the frequencies of all important grayscale values are the largest frequencies in the histogram. During enhancement, important grayscale values will not be swallowed up because their frequencies are too small, and a better enhancement effect can be achieved.
[0049] Patent CN117952974B discloses another method for calculating the importance of grayscale values. The logic of importance in this method is: when the number of pixels corresponding to the same grayscale value in multiple consecutive images increases, the importance of the grayscale value becomes greater, and the grayscale value will be enhanced in the future. However, the frequency of grayscale values that can reflect the main characteristics of garbage in the target area of the present invention changes little in two consecutive frames. The purpose of the present invention is to focus on enhancing the grayscale values that can reflect the main characteristics of garbage in the target area, so as to improve the accuracy of subsequent garbage category identification. However, the change in the frequency of grayscale values that can reflect the main characteristics of garbage in the target area does not conform to the logic of importance in patent CN117952974B. Therefore, when the corresponding importance calculation method in patent CN117952974B is used to enhance the target area corresponding to garbage in the present invention, the grayscale values that can reflect the main characteristics of garbage in the target area cannot be enhanced, and the enhancement effect is poor. For example, Figure 7 To use the method in patent CN117952974B Figure 3 The result of enhancement.
[0050] At this point, the limit contrast parameters of each frame are obtained.
[0051] S003. Determine the similarity of the grayscale range of the target area of each frame with that of the previous frame according to the difference between the grayscale range of the target area of each frame and the grayscale range of the target area of the previous frame, and when the grayscale range similarity is not less than a preset similarity threshold, modify the limit contrast parameter of each frame according to the frequency of the maximum value point in the grayscale histogram of the target area of each frame.
[0052] It should be noted that in the process of pouring garbage into the trash can, the angle of the garbage relative to the camera may change, and the garbage obscured in the previous frame may be revealed in the next frame, resulting in differences in the grayscale range of the target area of different frames. Therefore, the present invention measures the similarity of the grayscale range of the target area of each frame with the previous frame.
[0053] Specifically, obtain the grayscale range similarity between each frame and the target area of the previous frame:
[0054]
[0055] In the formula, Indicates Similarity of grayscale range of target area between frame and previous frame; For the The set of all grayscale values appearing in the target area of the frame represents the The grayscale range of the target area of the frame; For the The set of all grayscale values appearing in the target area of the frame represents the The grayscale range of the target area of the frame; For collection and The difference of appears in the target area of the frame, but in the A set of gray values that do not appear in the target area of the frame; Difference The number of elements in , which indicates the appears in the target area of the frame, but in the The number of gray values not present in the target area of the frame; For collection The number of elements in , which indicates the The number of grayscale values present in the target area of the frame; Represents an exponential function with a natural constant as its base.
[0056] when The smaller the time, the Most of the gray values in the target area of the frame are in the The target area of the frame has appeared. The grayscale value appearing in the target area of the frame is the same as the The grayscale values in the target area of the frame have a high overlap. The greater the similarity between the grayscale range of the target area of the frame and the previous frame; conversely, The larger the Most of the gray values that appear in the target area of the frame are The target area of the frame does not appear. The grayscale value appearing in the target area of the frame is the same as the The coincidence of gray values appearing in the target area of the frame is low. The smaller the similarity of the grayscale range of the target area of the frame to the previous frame.
[0057] It should be noted that when the grayscale range similarity between a certain frame and the target area of the previous frame is greater, the important grayscale value obtained based on the frequency difference of the grayscale value in the target area of the frame and the previous frame is more accurate, so that the limiting contrast parameter obtained based on the frequency of the important grayscale value is accurate. When the grayscale range similarity between a certain frame and the target area of the previous frame is smaller, the garbage that was blocked in the previous frame is revealed in the frame, so that there are new image features in the target area of the frame. The contrast parameter obtained based on the frequency of the important grayscale value can prevent the image features corresponding to the important grayscale value from being swallowed up during enhancement, but it may not be able to prevent the new image features from being swallowed up, so it is necessary to correct the limiting contrast parameter of the frame.
[0058] Specifically, a similarity threshold is preset , the implementer can set it according to the actual implementation situation, for example When the grayscale range similarity between a frame and the target area of the previous frame is not less than the preset similarity threshold When the grayscale range similarity between a frame and the target area of the previous frame is less than the preset similarity threshold, the limit contrast parameter of the frame is not modified; when the grayscale range similarity between a frame and the target area of the previous frame is less than the preset similarity threshold , the limit contrast parameter of the frame is modified.
[0059] The specific process of correcting the limit contrast parameter is as follows:
[0060] With the grayscale value as the horizontal axis and the frequency of the grayscale value in the target area of each frame as the vertical axis, a grayscale histogram in the target area of each frame is constructed to obtain all the maximum value points in the grayscale histogram in the target area of each frame. It should be noted that a peak in the grayscale histogram can be regarded as a grayscale value corresponding to an image feature, and the maximum value point is the peak value point, so the grayscale value corresponding to a maximum value point in the grayscale histogram can be regarded as the main grayscale value of an image feature in the target area, so each maximum value point can represent an image feature in the target area.
[0061] The limit contrast parameters of each frame are modified according to the frequency of the maximum points in the grayscale histogram of the target area of each frame:
[0062]
[0063] In the formula, Indicates Limit contrast parameter after frame correction; Indicates Limit contrast parameter before frame correction; Indicates The grayscale histogram of the target area of the frame The frequency corresponding to the maximum point; Indicates The mean value of the frequencies corresponding to all the maximum points in the grayscale histogram of the target area of the frame; Indicates The number of maximum points in the grayscale histogram of the target area of the frame; Represents an exponential function with a natural constant as its base.
[0064] Indicates The variance of the frequency corresponding to the maximum point in the grayscale histogram of the target area of the frame. When the variance is larger, it means that the The proportion of each image feature in the target area of the frame is different. In order to avoid swallowing up some image features with a smaller proportion, the limit contrast parameter needs to be further reduced. Since the frequency corresponding to the maximum point is between [0,1], the variance Also between [0,1], in order to use the variance to limit the contrast parameter reduction, the present invention adopts The function will Mapped to a value greater than 1, As a limiting contrast parameter The exponent of Make corrections so that Further reduce, when the variance The larger the value, the greater the contrast parameter The greater the reduction; on the contrary, when the variance The smaller the time, the more The proportion of each image feature in the target area of the frame is similar. When the target area of the frame is enhanced, the probability of image features being swallowed is small, and the limiting contrast parameter The smaller the reduction.
[0065] S004. When the grayscale range similarity between a certain frame and a target region of a previous frame is not less than a preset similarity threshold, the target region of the frame is enhanced using the limited contrast parameter of the frame, otherwise, the target region of the frame is enhanced using the corrected limited contrast parameter of the frame.
[0066] When the grayscale range similarity between a frame and the target area of the previous frame is not less than the preset similarity threshold When the target area of the frame is enhanced by using the limited contrast parameter of the frame, the enhanced result of the target area of the frame is obtained.
[0067] When the grayscale range similarity between a frame and the target area of the previous frame is less than the preset similarity threshold When the target area of the frame is enhanced by using the limited contrast adaptive histogram equalization method and the corrected limited contrast parameters of the frame, the enhanced result of the target area of the frame is obtained.
[0068] It should be noted that since the first frame of the captured surveillance video has no previous frame, it is impossible to obtain the limiting contrast parameter of the first frame and the corrected limiting contrast parameter. Therefore, the present invention directly uses the histogram equalization method to enhance the target area of the first frame.
[0069] So far, the enhancement of the target area of each frame is achieved, and the enhancement result of the target area of each frame is obtained.
[0070] For example Figure 8 In order to utilize the method of the present invention Figure 3 The enhanced results are compared with Figures 4 to 7 In contrast, the method of the present invention is used to Figure 3 The enhancement effect is better and the enhancement result is clearer.
[0071] S005. Identify the garbage category based on the enhanced results of the target area of each frame, determine whether the garbage category matches the category of the garbage bin into which the corresponding garbage is placed, and implement garbage bin classification supervision.
[0072] The present invention uses a neural network to identify the category of garbage to be placed in each frame. The specific content of the neural network is as follows:
[0073] The structure of the neural network is a fully connected neural network, the input of the neural network is the enhanced result of the target area of each frame, and the output is the category of the garbage to be placed in each frame. The data set used by the neural network is: a data set consisting of the results of each frame of the surveillance video containing different types of garbage enhanced by the method of the present invention, and the label is the type of each garbage in the enhanced result, for example, recyclable garbage is marked as 0, kitchen waste is marked as 1, hazardous waste is marked as 2, and other garbage is marked as 3. The loss function of the neural network is the cross entropy loss.
[0074] The enhancement results of the target area of each frame are input into the trained neural network to identify the category of garbage to be disposed contained in each frame.
[0075] Determine whether the category of the garbage to be disposed matches the category of the garbage bin in which it is placed. If not, an alarm is generated to prompt the garbage disposal personnel to put the garbage again. If the garbage disposal personnel refuse to put the garbage again, the person who puts the garbage in the surveillance video is identified through face recognition, a penalty ticket is issued to the garbage disposal personnel, and a garbage classification education video is pushed to the garbage disposal personnel, thereby achieving the effect of garbage bin classification supervision.
[0076] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for monitoring garbage bin classification, characterized in that: include: Determine the target area in each frame of the surveillance video, where the target area is the area corresponding to the garbage to be placed; Determine the importance of the grayscale value in the target frame according to the frequency of the grayscale value in the target area of the target frame and the frequency difference of the grayscale value in the target area of the target frame and the previous frame, wherein the importance is positively correlated with the frequency and negatively correlated with the frequency difference; select the important grayscale value according to the importance, and determine the limiting contrast parameter of the target frame according to the frequency of the important grayscale value in the target area of the target frame; The importance satisfies the expression: ; In the formula, Indicates Gray value in frame The importance of Indicates Grayscale value in the target area of the frame frequency; Indicates The maximum frequency among the frequencies of all gray values in the target area of the frame; Indicates Grayscale value in the target area of the frame frequency; Indicates the absolute value symbol; represents the maximum value function; represents an exponential function with a natural constant as base; Determine the similarity of the grayscale ranges of the target frame and the target region of the previous frame according to the difference between the grayscale range of the target region of the target frame and the grayscale range of the target region of the previous frame; In response to the grayscale range similarity being not less than a preset similarity threshold, enhancing the target region of the target frame using a restricted contrast parameter of the target frame; Otherwise, the restricted contrast parameter of the target frame is corrected according to the frequency of the maximum point in the grayscale histogram of the target area of the target frame, the corrected restricted contrast parameter is negatively correlated with the variance of the frequency of the maximum point, and the target area of the target frame is enhanced using the corrected restricted contrast parameter of the target frame; The garbage category is identified based on the enhancement results of the target area of each frame, and it is determined whether the garbage category matches the category of the garbage bin into which the corresponding garbage is placed, thereby realizing garbage bin classification supervision.
2. A method for monitoring garbage bin classification according to claim 1, characterized in that: Determining the target area in each frame of the surveillance video includes: The semantic segmentation method is used to identify the area corresponding to the garbage to be disposed in each frame of the surveillance video as the target area of each frame.
3. A method for monitoring garbage bin classification according to claim 1, characterized in that: The screening of important gray values according to their importance includes: In response to the importance of the grayscale value being greater than a preset importance threshold, the grayscale value is taken as an important grayscale value.
4. A method for monitoring garbage bin classification according to claim 1, characterized in that: The step of determining the limiting contrast parameter of the target frame according to the frequency of the important grayscale values in the target area of the target frame comprises: The minimum value of the frequency of each important gray value of the target frame in the target area of the target frame is obtained as the limiting contrast parameter of the target frame.
5. A method for monitoring garbage bin classification according to claim 1, characterized in that: The grayscale range similarity between the target frame and the target area of the previous frame satisfies the expression: ; In the formula, Indicates Similarity of grayscale range of target area between frame and previous frame; Indicates The set of all gray values appearing in the target area of the frame; For the The set of all gray values appearing in the target area of the frame; For collection and The difference of Difference The number of elements in ; For collection The number of elements in ; Represents an exponential function with a natural constant as its base.
6. A method for monitoring garbage bin classification according to claim 1, characterized in that: The modified limiting contrast parameter satisfies the expression: ; In the formula, Indicates Limit contrast parameter after frame correction; Indicates Limit contrast parameter before frame correction; Indicates The grayscale histogram of the target area of the frame The frequency corresponding to the maximum point; Indicates The mean value of the frequencies corresponding to all the maximum points in the grayscale histogram of the target area of the frame; Indicates The number of maximum points in the grayscale histogram of the target area of the frame; Represents an exponential function with a natural constant as its base.
7. A method for monitoring garbage bin classification according to claim 1, characterized in that: The identifying of garbage categories according to the enhancement results of the target area of each frame includes: The enhancement results of the target area of each frame are input into the neural network to identify the category of garbage to be disposed contained in each frame.
Citation Information
Patent Citations
Construction-dimension monitoring video image enhancement method based on contrast-limited adaptive histogram equalization method
CN114463208A
Image processing methods for organoid identification
CN117952974B
Event frame-based feature point matching method and electronic equipment
CN114140365A
Intelligent equipment for automatically classifying and recycling garbage and intelligent garbage classifying system thereof
CN116573307A
Video image transmission quality enhancement method and system
CN117408890A
