A garbage classification image region of interest adaptive acquisition method

CN118015254BActive Publication Date: 2026-09-18NORTHEASTERN UNIV CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410161292.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-05
Publication Date
2026-09-18
Estimated Expiration
2044-02-05

AI Technical Summary

Technical Problem

[0003]针对上述问题,本发明提供一种垃圾分类图像感兴趣区域自适应获取方法,以解决垃圾分类图像处理中感兴趣区域获取不准确的问题

Benefits of technology

[0049] Compared with existing technologies, the advantage of this invention lies in its innovative adaptive segmentation threshold method. Traditional garbage image processing methods typically use fixed thresholds for image segmentation, which results in inconsistent performance across garbage images in different scenes and lighting conditions, leading to unsatisfactory segmentation results. This invention overcomes this limitation by introducing adaptive calculations of contrast and saturation. By dynamically adjusting the segmentation threshold according to the image's own characteristics, it can better adapt to image changes, thereby improving the stability and accuracy of the segmentation results. In practical applications with constantly changing lighting conditions, traditional methods may lead to misjudgments or omissions due to inappropriate threshold selection. The adaptive segmentation threshold method of this invention makes the system more adaptable, enabling more reliable identification and extraction of regions of interest in garbage images under various complex situations. This adaptive method not only improves the robustness of the garbage classification system but also reduces dependence on pre-set parameters. By automatically adjusting the segmentation threshold based on image content, it can more flexibly cope with changing real-world situations. Therefore, this invention has significant advantages in improving segmentation results, handling complex scenes, and stabilizing segmentation performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118015254B_ABST
    Figure CN118015254B_ABST
Patent Text Reader

Abstract

The application discloses a garbage classification image region of interest adaptive acquisition method, and relates to the garbage image processing field in the garbage classification method research based on images. By introducing the adaptive calculation of the segmentation threshold of the image according to the contrast and saturation, the segmentation threshold can be intelligently adjusted according to the characteristics of the image itself, so that the region of interest in the garbage image can be better captured. By the adaptive region of interest acquisition method, the adaptability of the garbage classification system to complex scenes and changing conditions can be improved, and the garbage classification effect is further optimized. The application introduces the adaptive calculation of the segmentation threshold, improves the flexibility and accuracy of the image processing, and provides strong support for the further development and practical application of the garbage classification technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of garbage image processing in the research of image-based garbage classification methods, and particularly to an adaptive method for obtaining the region of interest in garbage classification images. Background Technology

[0002] Waste sorting refers to classifying household waste according to certain standards to facilitate effective resource recycling and environmental protection. It is an important means of urban environmental governance and a significant research direction in scientific research. Image processing technology, by analyzing and processing waste image information, can help improve the accuracy and efficiency of waste sorting. Identifying regions of interest (ROIs) is a key task in image processing, primarily used to determine specific regions in an image that contain crucial information. Common methods for identifying ROIs in waste sorting include object detection algorithms and image segmentation algorithms. Because these are based on deep learning methods, they typically require a large amount of labeled data for training, consuming significant computational resources and impacting real-time performance. For simple waste sorting tasks with limited data and high real-time requirements, traditional image segmentation methods are more effective. However, traditional image segmentation methods usually use fixed thresholds to divide pixels in an image. This method performs inconsistently in waste images under different scenes and lighting conditions, resulting in poor segmentation results and inaccurate ROI identification. Summary of the Invention

[0003] To address the aforementioned problems, this invention provides an adaptive method for obtaining regions of interest (ROIs) in garbage sorting images, thereby resolving the issue of inaccurate ROI acquisition in garbage sorting image processing.

[0004] The technical solution of this invention is as follows:

[0005] An adaptive method for obtaining regions of interest (ROIs) in garbage classification images includes the following steps:

[0006] Step 1: Obtain a colored image of the garbage, extract the R, G, and B channel grayscale images of the garbage image, and obtain the pixel value of each pixel in the three grayscale images. in Let be the pixel value of the pixel at row i and column j in the R channel of the image. Let be the pixel value of the pixel at row i and column j in the G channel of the image. Let i be the pixel value of the pixel at the i-th row and j-th column in the B channel of the image, where i is the row number and j is the column number;

[0007] Step 2: Calculate the average saturation of pixels in the garbage image based on the pixel values ​​of each pixel in the three grayscale images;

[0008]

[0009]

[0010] Among them, S ij The saturation of the pixel at row i and column j. Let be the average saturation of the pixels in the garbage image, and n be the number of pixels in the garbage image;

[0011] Step 3: Calculate the segmentation index Y of the pixels in the garbage image;

[0012] Step 3.1: Calculate the segmentation index Y of the R channel in the grayscale image of the garbage image. R ;

[0013] The formula for calculating the segmentation index based on pixel values ​​is:

[0014]

[0015]

[0016] Where, x i,j f(x) is the pixel value of the pixel at the i-th row and j-th column. i,j ) represents the pixel value x i,j The corresponding segmentation index, k is the pixel position increment involved in the calculation of the segmentation index, and α is the segmentation coefficient.

[0017] The segmentation index Y of pixels in an R-channel grayscale image is calculated using the formula for the segmentation index. R :

[0018]

[0019] Among them, Y R pixel value The corresponding R-channel segmentation index.

[0020] Step 3.2: Calculate the segmentation index Y of the G channel in the grayscale image of the garbage image. G ;

[0021] The segmentation index Y of pixels in a G-channel grayscale image is calculated using the formula for the segmentation index. G :

[0022]

[0023] Among them, Y G pixel value The corresponding segmentation index of the G channel;

[0024] Step 3.3: Calculate the segmentation index Y of the B channel in the grayscale image of the garbage image. B;

[0025] The segmentation index Y of pixels in a B-channel grayscale image is calculated using the formula for the segmentation index. B :

[0026]

[0027] Among them, Y B pixel value The corresponding segmentation index of channel B.

[0028] Step 3.4: Calculate the segmentation index Y for each pixel in the garbage image;

[0029] Y = Y R +Y G +Y B

[0030] Where Y is the segmentation index of each pixel in the garbage image;

[0031] Step 4: Calculate the adaptive segmentation threshold T for pixels in the garbage image;

[0032] Step 4.1: Sort all pixels in the garbage image in ascending order according to the segmentation index, and denote the total number of pixels as n;

[0033] Step 4.2: Calculate the average RGB pixel value of each pixel in the image;

[0034]

[0035] Among them, M ij Let be the average RGB pixel value of the pixel at row i and column j in the garbage image;

[0036] Step 4.3: Calculate the contrast C of the image based on the average RGB pixel value of each pixel;

[0037]

[0038] Where C is the image contrast, M max M is the maximum value of the average RGB pixel value. min It is the minimum value of the RGB pixel mean.

[0039] Step 4.4: Calculate the intermediate variable n based on the image contrast C and the number of pixels in the garbage image. c Value, and the nth c The segmentation index of each pixel is set as the segmentation threshold T;

[0040] intermediate variable n c The formula for calculating the value is as follows:

[0041]

[0042] Where, n c As an intermediate variable;

[0043] Step 5: Mark the pixels with a segmentation index greater than the segmentation threshold T as the segmentation boundary, and draw the mask image of the garbage image;

[0044] Step 6: Extract the region of interest from the garbage image;

[0045] Step 6.1: Crop the rows and columns of the mask image where all gray values ​​are zero around the edges of the garbage image;

[0046] Step 6.2: When the cropped image is a rectangle, use a white background to fill in the cropped image into a regular quadrilateral, ensuring that the cropped image is in the exact center of the new image.

[0047] Step 6.3: Use interpolation to adjust the size of the new image to the set size to obtain the region of interest of the garbage image.

[0048] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0049] Compared with existing technologies, the advantage of this invention lies in its innovative adaptive segmentation threshold method. Traditional garbage image processing methods typically use fixed thresholds for image segmentation, which results in inconsistent performance across garbage images in different scenes and lighting conditions, leading to unsatisfactory segmentation results. This invention overcomes this limitation by introducing adaptive calculations of contrast and saturation. By dynamically adjusting the segmentation threshold according to the image's own characteristics, it can better adapt to image changes, thereby improving the stability and accuracy of the segmentation results. In practical applications with constantly changing lighting conditions, traditional methods may lead to misjudgments or omissions due to inappropriate threshold selection. The adaptive segmentation threshold method of this invention makes the system more adaptable, enabling more reliable identification and extraction of regions of interest in garbage images under various complex situations. This adaptive method not only improves the robustness of the garbage classification system but also reduces dependence on pre-set parameters. By automatically adjusting the segmentation threshold based on image content, it can more flexibly cope with changing real-world situations. Therefore, this invention has significant advantages in improving segmentation results, handling complex scenes, and stabilizing segmentation performance. Attached Figure Description

[0050] Figure 1 This is a flowchart of an adaptive method for obtaining the region of interest in a garbage classification image according to an embodiment of the present invention;

[0051] Figure 2 This is the original color garbage image of an embodiment of the present invention;

[0052] Figure 3 The red channel of the garbage image in this embodiment of the invention;

[0053] Figure 4 The green channel for garbage images in this embodiment of the invention;

[0054] Figure 5 The blue channel of the garbage image in this embodiment of the invention;

[0055] Figure 6 Here are the mask images of garbage images in this embodiment of the invention, where (a) is the mask image obtained by this method; (b) and (c) are the mask images obtained after setting a segmentation threshold based on experience;

[0056] Figure 7 This refers to the region of interest obtained in this embodiment of the invention.

[0057] Figure 8 This is the completed region of interest according to an embodiment of the present invention;

[0058] Figure 9 These are cropped and sample images based on the requirements of waste sorting in this embodiment of the invention. Detailed Implementation

[0059] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0060] This patent proposes a method for adaptively acquiring regions of interest (ROIs) in waste sorting images, aiming to improve the automation and accuracy of waste sorting. The innovation of this patent lies in introducing an adaptive calculation of the image segmentation threshold based on contrast and saturation. This method intelligently adjusts the segmentation threshold according to the characteristics of the image itself, thereby better capturing the ROI in the waste image. This adaptive ROI acquisition method can improve the adaptability of the waste sorting system to complex scenes and changing conditions, further optimizing the waste sorting effect. Addressing the shortcomings of traditional waste sorting image processing methods, this patent improves the flexibility and accuracy of image processing by introducing adaptive segmentation threshold calculation, providing strong support for the further development and practical application of waste sorting technology.

[0061] An adaptive method for obtaining regions of interest in garbage classification images, such as Figure 1 As shown, it includes the following steps:

[0062] The original image is shown below. Figure 2 Taking an example, the embodiments of the present invention will be described.

[0063] Step 1: Obtain as follows Figure 2 The color garbage image shown is used to extract the R, G, and B channel grayscale images. Figure 3This is a red channel diagram. Figure 4 This is a green channel map. Figure 5 This is the blue channel image, and the corresponding pixel value for each pixel in the three grayscale images is obtained. in Let be the pixel value of the pixel at row i and column j in the R channel of the image. Let be the pixel value of the pixel at row i and column j in the G channel of the image. Let i be the pixel value of the pixel at the i-th row and j-th column in the B channel of the image, where i is the row number and j is the column number;

[0064] Step 2: Calculate the average saturation of pixels in the garbage image based on the pixel values ​​of each pixel in the three grayscale images. The calculated values ​​are...

[0065]

[0066]

[0067] Among them, S ij The saturation of the pixel at row i and column j. Let be the average saturation of the pixels in the garbage image, and n be the number of pixels in the garbage image;

[0068] Step 3: Calculate the segmentation index Y of the pixels in the garbage image;

[0069] Step 3.1: Calculate the segmentation index Y of the R channel in the grayscale image of the garbage image. R ;

[0070] The formula for calculating the segmentation index based on pixel values ​​is:

[0071]

[0072]

[0073] Where, x i,j f(x) is the pixel value of the pixel at the i-th row and j-th column. i,j ) represents the pixel value x i,j The corresponding segmentation index, k is the pixel position increment involved in the calculation of the segmentation index, and α is the segmentation coefficient.

[0074] The segmentation index Y of pixels in an R-channel grayscale image is calculated using the formula for the segmentation index. R :

[0075]

[0076] Among them, Y R pixel value The corresponding R-channel segmentation index.

[0077] Step 3.2: In the G channel grayscale image of the garbage image ( Figure 4 ), calculate the segmentation index Y of channel G. G The matrix; the segmentation index Y of pixels in the G-channel grayscale image is calculated using the formula for the segmentation index. G :

[0078]

[0079] Among them, Y G pixel value The corresponding segmentation index of the G channel;

[0080] Step 3.3: In the B channel grayscale image of the garbage image ( Figure 5 ), calculate the segmentation index Y of channel B. B The matrix; the segmentation index Y of pixels in the B-channel grayscale image is calculated using the formula for the segmentation index. B :

[0081]

[0082] Among them, Y B pixel value The corresponding segmentation index of channel B.

[0083] Step 3.4: Calculate the Y value of each pixel in the garbage image and form a new matrix;

[0084] Y = Y R +Y G +Y B

[0085] Where Y is the segmentation index of each pixel in the garbage image;

[0086] Step 4: Calculate the adaptive segmentation threshold T for pixels in the garbage image;

[0087] Step 4.1: Arrange all pixels in the garbage image in ascending order according to the segmentation index, and denote the total number of pixels as n; calculate n = 388800.

[0088] Step 4.2: Calculate the average RGB pixel value of each pixel in the image;

[0089]

[0090] Among them, M ij Let be the average RGB pixel value of the pixel at row i and column j in the garbage image;

[0091] Step 4.3: Calculate the contrast ratio C of the image based on the average RGB pixel value of each pixel; the calculated C = 31.0002.

[0092]

[0093] Where C is the image contrast, M max M is the maximum value of the average RGB pixel value. min It is the minimum value of the RGB pixel mean.

[0094] Step 4.4: Calculate the intermediate variable n based on the image contrast C and the number of pixels in the garbage image. c The value is calculated using the following formula, and the nth value is... c The segmentation index of each pixel is set as the segmentation threshold T;

[0095]

[0096] Where, n c As an intermediate variable;

[0097] n was calculated c =247020, T=245.

[0098] Step 5: Mark the pixels with a segmentation index greater than the segmentation threshold T as the segmentation boundaries, and draw a mask image of the garbage image, such as... Figure 6 As shown in (a). Mask images obtained by other methods ( Figure 6 (b) and Figure 6 Compared to (c), Figure 6 (a) It is more conducive to focusing on the edge information of objects.

[0099] Step 6: Extract the region of interest from the garbage image;

[0100] Step 6.1: In the garbage image, crop the rows and columns where all gray values ​​around the mask image are zero, such as... Figure 7 As shown.

[0101] Step 6.2: When the cropped image is rectangular, use a white background to fill in the cropped image into a regular quadrilateral, ensuring that the cropped image is centered in the new image, such as... Figure 8 As shown.

[0102] Step 6.3: Use interpolation to resize the image to 32 pixels * 32 pixels to obtain the region of interest (ROI) of the garbage image, such as... Figure 9 As shown.

Claims

1. A method for adaptive acquisition of image regions of interest for waste sorting, characterized in that, Includes the following steps: Step 1: Obtain a colored garbage image, extract the R, G, and B channel grayscale images of the garbage image respectively, and obtain the pixel value corresponding to each pixel in the three grayscale images; Step 2: Calculate the average saturation of pixels in the garbage image based on the pixel values ​​of each pixel in the three grayscale images; Step 3: Calculate the segmentation index of the pixel points in the garbage image Y ; Step 3 specifically includes: Step 3.1: Calculate the segmentation index of the R channel in the grayscale image of the garbage image. Y R ; The formula for calculating the segmentation index based on pixel values ​​is: in, For row number, For column numbers, The average saturation of the pixels in the garbage image. For the first Line number The pixel value of the pixel in the column. pixel value The corresponding segmentation index, where k is the pixel position increment involved in calculating the segmentation index. The dividing coefficient; calculating the segmentation index of the pixel points in the R channel gray image by using the formula of the segmentation index Y R : in, For the first Line number The pixel value of the pixel at the column in the image's R channel. Y R pixel value The corresponding R-channel segmentation index; Step 3.2: Calculate the segmentation index of the G channel in the grayscale image of the garbage image. Y G ; The segmentation index of pixels in a G-channel grayscale image is calculated using the formula for the segmentation index. Y G : in, For the first Line 1 The pixel value of the pixel at the column in the image's G channel. Y G pixel value The corresponding segmentation index of the G channel; Step 3.3: In the B-channel grayscale image of the junk image, calculate the segmentation index of the B-channel Y B ; calculating the segmentation index of the pixel point in the B channel gray image by using the formula of the segmentation index Y B : in, For the first Line 1 The pixel value of the pixel at the column in the B channel of the image. Y B pixel value The corresponding segmentation index of channel B; Step 3.4: Calculate the segmentation index of each pixel in the garbage image Y ; Where Y is the segmentation index of each pixel in the garbage image; Step 4: Calculate adaptive segmentation threshold of pixel points in garbage image T ; Step 4 specifically includes: Step 4.1: Arrange all the pixel points in the garbage image in ascending order according to the segmentation index, and the number of all the pixel points is denoted as n ; Step 4.2: Calculate the average RGB pixel value of each pixel in the image; Step 4.3: Calculate the contrast of the image according to the RGB pixel mean of each pixel C ; Step 4.4: According to the contrast of the image C and the number of pixels in the garbage image, calculate the intermediate variable value, and set the segmentation index of the first pixel point as the segmentation threshold T; wherein is an intermediate variable; Step 5: mark the pixel points with segmentation index greater than the segmentation threshold as segmentation boundary, and draw a mask image of the garbage image. T Step 5: mark the pixel points with segmentation index greater than the segmentation threshold as segmentation boundary, and draw a mask image of the garbage image. Step 6: Extract the region of interest from the garbage image.

2. The method of claim 1, wherein, The method for calculating the average saturation in step 2 is as follows: wherein, The The saturation of a pixel at row r and column c, is the number of pixels in the garbage image.

3. The method of claim 1, wherein, Step 6 specifically includes: Step 6.1: Crop the rows and columns of the mask image where all gray values ​​are zero around the edges of the garbage image; Step 6.2: When the cropped image is a rectangle, use a white background to fill in the cropped image into a regular quadrilateral, ensuring that the cropped image is in the exact center of the new image; Step 6.3: Use interpolation to adjust the size of the new image to the set size to obtain the region of interest of the garbage image.

4. The method of claim 1, wherein, The average RGB pixel value of each pixel is: wherein, is the average of the RGB pixels of the pixel point at the row and the column in the garbage image.

5. The method of claim 1, wherein, Contrast of the image C Is; wherein, C is the contrast of the image, is the maximum of the mean of the RGB pixels, is the minimum of the mean of the RGB pixels.

Citation Information

Patent Citations

  • Image enhancement method based on image intensity threshold value and self-adaptive cutting

    CN110852955A

  • Color image region-of-interest extraction method based on decision-making level fusion

    CN111104943A