A plastic material identification method, device, equipment and readable storage medium
By segmenting and selecting hyperspectral images and combining them with a hyperspectral classification model, the problems of low accuracy and high cost in plastic material identification in existing technologies have been solved, achieving non-destructive, fast, and accurate plastic material identification.
Patent Information
- Application Number
- CN202511377437.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-09-25
AI Technical Summary
Existing technologies for identifying plastic materials suffer from low accuracy, high cost, expensive equipment, and are unsuitable for small and medium-sized applications. In particular, for plastics containing fillers or composite modifications, the accuracy of spectral analysis decreases, while physical/chemical detection methods are destructive and inefficient.
By acquiring hyperspectral images, performing black-and-white correction, and extracting grayscale, pseudo-color, and reflectance data, the SAM segmentation algorithm is used to remove interference, and a hyperspectral classification model is used to identify plastic materials, avoiding destructive detection and reducing costs.
It achieves non-destructive and rapid identification of plastic materials, improves identification accuracy, reduces identification costs, and is suitable for small and medium-sized applications.
Smart Images

Figure CN120877128B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, in particular to a plastic material identification method, device and equipment and readable storage medium. BACKGROUND
[0002] At present, the technical means for identifying plastic materials mainly include spectral analysis method and physical / chemical detection method. Among them, the spectral analysis method is the most widely used, and the typical representatives are near-infrared spectrum (NIR) and mid-infrared spectrum (MIR) detection. This method obtains the reflectivity or transmissivity characteristics of the material at different wavelengths, and compares it with the known spectrum library, so as to identify the plastic type. The advantage is non-destructive, fast, and suitable for online detection, but the limitation is also obvious: the difference of different plastics on the spectrum curve is sometimes not significant, especially for plastics containing fillers, pigments or composite modified plastics, the spectral characteristics are easy to overlap, resulting in a decrease in identification accuracy; at the same time, the spectral instrument is expensive, and the equipment maintenance cost is high, which limits its popularization in small and medium-sized application scenarios.
[0003] The physical / chemical detection method such as density method, solvent method and combustion method, etc. judges the plastic category through physical parameters or combustion products, although the method is intuitive and low in cost, but it is mostly destructive detection, and the efficiency is low, which is not suitable for large-scale and real-time identification.
[0004] In summary, the current plastic material identification method still has many problems, therefore, there is an urgent need for a plastic material identification method that can overcome the above-mentioned defects. SUMMARY
[0005] The purpose of the present application is to provide a plastic material identification method, device, equipment and readable storage medium, by extracting a hyperspectral image, then segmenting and selecting the hyperspectral image, removing the interference part in the hyperspectral image, and then identifying the material based on a hyperspectral classification model, this method avoids the destruction of the plastic, and reduces the cost of plastic material identification, and increases the accuracy of plastic material identification.
[0006] In order to achieve the above purpose, the present application provides the following technical scheme:
[0007] In the first aspect, the present application provides a plastic material identification method, which comprises:
[0008] Obtaining the original hyperspectral image of the plastic material to be identified, and carrying out black and white correction on the original hyperspectral image to obtain a reflectivity image;
[0009] Extracting the gray scale image, pseudo-color image and reflectivity data of the target area from the reflectivity image;
[0010] Segment and select the original hyperspectral image based on the grayscale image, the false color image and the reflectance data of the target region to obtain target data;
[0011] Input the target data into the hyperspectral classification model to obtain a material identification result of the plastic object to be identified.
[0012] In some embodiments, segmenting and selecting the original hyperspectral image based on the grayscale image, the false color image and the reflectance data of the target region to obtain target data includes:
[0013] Segmenting the false color image using the SAM segmentation algorithm to remove the cap part and the label region in the original hyperspectral image to obtain a first image;
[0014] Based on the grayscale image, removing the high light area and the low light area in the first image to obtain a second image;
[0015] Based on the reflectance data, using a preset window to select target data from the second image.
[0016] In some embodiments, segmenting the false color image using the SAM segmentation algorithm to remove the cap part and the label region in the original hyperspectral image to obtain a first image includes:
[0017] Segmenting the false color image using the SAM segmentation algorithm to obtain a partial mask of the plastic object to be identified;
[0018] Performing contour detection on the partial mask and calculating the circumscribed rectangle of the partial mask;
[0019] Determining the circumscribed rectangle region of the circumscribed rectangle in the false color image;
[0020] Inputting the circumscribed rectangle region into the pre-trained cap and bottle body classifier to remove the cap part and the label region to obtain a first image.
[0021] In some embodiments, based on the grayscale image, removing the high light area and the low light area in the first image to obtain a second image includes:
[0022] Traversing the grayscale image, regarding the region with a grayscale value greater than a first grayscale threshold as a high light area, and regarding the region with a grayscale value less than a second grayscale threshold as a low light area; the first grayscale threshold is greater than the second grayscale threshold;
[0023] Removing the high light area and the low light area from the first image to obtain a second image.
[0024] In some embodiments, based on the reflectance data, using a preset window to select target data from the second image includes:
[0025] Traversing the second image and uniformly selecting a preset number of effective pixel points;
[0026] centered on each valid pixel point, a preset number of data cubes are selected according to the reflectivity data and a window of a preset size;
[0027] The target data is input into the hyperspectral classification model to obtain a material identification result of the plastic object to be identified.
[0028] In some embodiments, the target data is input into the hyperspectral classification model to obtain a material identification result of the plastic object to be identified, including:
[0029] The target data is input into the hyperspectral classification model to obtain a material identification result of the plastic object to be identified.
[0030] The target data is input into the hyperspectral classification model to obtain a material identification result of the plastic object to be identified.
[0031] In some embodiments, the gray scale image, the pseudo-color image and the reflectivity data of the target region are extracted from the reflectivity image, including:
[0032] Each pixel in the reflectivity image is multiplied by a preset parameter, and the average value is taken in the spectral channel to obtain a gray scale image corresponding to the original hyperspectral image;
[0033] The reflectivity data of the reflectivity image is extracted, and the spectral of the preset three wave bands is converted into a pseudo-color image from the reflectivity data;
[0034] The target region is selected from the gray scale image corresponding to the original hyperspectral image, and the gray scale image, the pseudo-color image and the reflectivity data corresponding to the target region are determined.
[0035] In some embodiments, the original hyperspectral image is subjected to black and white correction to obtain a reflectivity image, including:
[0036] Dark background hyperspectral data and white background hyperspectral data corresponding to the original hyperspectral image are collected;
[0037] The original hyperspectral image is subjected to black and white correction according to the dark background hyperspectral data and the white background hyperspectral data to obtain a reflectivity image.
[0038] In a second aspect, the present application also provides a plastic material identification device, which comprises:
[0039] An image acquisition module is configured to acquire an original hyperspectral image of a plastic object to be identified, and to perform black and white correction on the original hyperspectral image to obtain a reflectivity image;
[0040] An image extraction module is configured to extract a gray scale image, a pseudo-color image and reflectivity data of a target region from the reflectivity image;
[0041] The data acquisition module is configured to perform segmentation and selection processing on the original hyperspectral image based on the grayscale image, the false color image and the reflectance data of the target region to obtain target data.
[0042] The material identification module is configured to input the target data into the hyperspectral classification model to obtain a material identification result of the plastic object to be identified.
[0043] In a third aspect, the present application also provides an electronic device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the plastic material identification method provided in the first aspect when executing the computer program.
[0044] In a fourth aspect, the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the plastic material identification method provided in the first aspect.
[0045] In a fifth aspect, the present application also provides a computer program product, which comprises a computer program, and the computer program is executable on a processor to implement the plastic material identification method provided in the first aspect.
[0046] The plastic material identification method provided in the present application first acquires an original hyperspectral image of a plastic object to be identified, and performs black and white correction on the original hyperspectral image to obtain a reflectance image; then extracts a grayscale image, a false color image and reflectance data of a target region from the reflectance image; then performs segmentation and selection processing on the original hyperspectral image based on the grayscale image, the false color image and the reflectance data of the target region to obtain target data; and finally inputs the target data into a hyperspectral classification model to obtain a material identification result of the plastic object to be identified. By extracting the hyperspectral image, then performing segmentation and selection on the hyperspectral image to remove the interference part in the hyperspectral image, and then performing material identification based on the hyperspectral classification model, the method avoids damaging the plastic, reduces the cost of plastic material identification, and increases the accuracy of plastic material identification.
[0047] The above description is only a summary of the technical solutions of the present application. In order to more clearly understand the technical means of the present application, and to implement the content of the description, the following will describe the preferred embodiments of the present application in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0048] Figure 1 A flowchart of a plastic material identification method according to an embodiment of the present application;
[0049] Figure 2 A false color image of a target region according to an embodiment of the present application;
[0050] Figure 3 An overall mask plate corresponding to the plastic article to be identified shown in an embodiment of the present application;
[0051] Figure 4 A bottle cap mask plate corresponding to the plastic article to be identified shown in an embodiment of the present application;
[0052] Figure 5 A label mask plate corresponding to the plastic article to be identified shown in an embodiment of the present application;
[0053] Figure 6 An outer-rectangular region of the bottle cap in a color drawing shown in an embodiment of the present application;
[0054] Figure 7 An outer-rectangular region of the label in a color drawing shown in an embodiment of the present application;
[0055] Figure 8 A structural schematic diagram of a plastic material identification device shown in an embodiment of the present application;
[0056] Figure 9 A structural schematic diagram of another plastic material identification device shown in an embodiment of the present application;
[0057] Figure 10 An electronic device structural schematic diagram provided by an embodiment of the present application. DETAILED DESCRIPTION
[0058] The technical solutions of the present application will be described clearly and completely below with reference to the drawings. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0059] It should be noted that the description of "one embodiment", "embodiment", "example embodiment" and the like in the specification means that the described embodiment can include a specific feature, structure or characteristic, but not every embodiment must include these specific features, structures or characteristics. In addition, such expressions do not mean the same embodiment. Further, when a specific feature, structure or characteristic is described in connection with an embodiment, it is indicated that such a feature, structure or characteristic is combined into other embodiments within the knowledge of those skilled in the art, whether or not it is explicitly described.
[0060] In addition, the technical features involved in different embodiments of the present application described below can be combined with each other as long as there is no conflict.
[0061] In some embodiments, as Figure 1As shown, a plastic material identification method is provided, and the specific method comprises the following steps:
[0062] S101, obtaining an original hyperspectral image of a plastic object to be identified, and performing black and white correction on the original hyperspectral image to obtain a reflectivity image.
[0063] Specifically, the hyperspectral camera can be used to capture the original hyperspectral image of the plastic object to be identified.
[0064] Optionally, the process of performing black and white correction on the original hyperspectral image to obtain the reflectivity image comprises: collecting dark background hyperspectral data and white background hyperspectral data corresponding to the original hyperspectral image; and performing black and white correction on the original hyperspectral image according to the dark background hyperspectral data and the white background hyperspectral data to obtain the reflectivity image.
[0065] Specifically, the dark background hyperspectral data of the plastic object to be identified can be collected by covering the lens cover of the hyperspectral camera, and then the white background hyperspectral data of the plastic object to be identified can be collected by opening the lens cover of the hyperspectral camera. Then, the original hyperspectral image is corrected according to the dark background hyperspectral data and the white background hyperspectral data to obtain the reflectivity image, and the specific calculation formula is as follows:
[0066] ;
[0067] Wherein, is the reflectivity image after black and white correction, is the original hyperspectral image, is the white background hyperspectral image, is the dark background hyperspectral image.
[0068] S102, extracting a gray scale image, a pseudo-color image and reflectivity data of a target region from the reflectivity image.
[0069] Optionally, each pixel in the reflectivity image is multiplied by a preset parameter, and the average value is taken in the spectral channel to obtain the gray scale image corresponding to the original hyperspectral image; the reflectivity data of the reflectivity image is extracted, and the spectral of the reflectivity data of the three preset wave bands is selected to convert into a pseudo-color image; the target region is selected from the gray scale image corresponding to the original hyperspectral image, and the gray scale image, the pseudo-color image (such as Figure 2 as shown, Figure 2 is the pseudo-color image of the target region) and the reflectivity data corresponding to the target region are determined.
[0070] Exemplarily, the preset parameter can be set as 255, each pixel in the reflectivity image is multiplied by 255, and then average values are taken in the spectral channel dimension to obtain a gray scale image corresponding to the original hyperspectral image. The preset three wave bands can be 50, 100 and 150. Spectra of the 50, 100 and 150 wave bands are selected from the reflectivity data to be converted into a pseudo-color image. The target region can be manually calibrated in the gray scale image. The target region corresponding gray scale image and pseudo-color image are cut from the gray scale image and pseudo-color image, and the reflectivity data corresponding to the target region is determined.
[0071] In S103, the original hyperspectral image is segmented and selected based on the gray scale image, the pseudo-color image and the reflectivity data of the target region to obtain target data.
[0072] Optionally, the SAM segmentation algorithm can be used to segment the pseudo-color image to remove the cap part and the label region in the original hyperspectral image to obtain a first image. Based on the gray scale image, the high light region and the low light region in the first image are removed to obtain a second image. Based on the reflectivity data, the target data is selected from the second image by using a preset window.
[0073] Specifically, the SAM segmentation algorithm is used to segment the pseudo-color image to obtain a partial mask template of the plastic article to be identified. Contour detection is performed on the partial mask template, and the circumscribed rectangle of the partial mask template is calculated. The circumscribed rectangle region of the circumscribed rectangle in the pseudo-color image is determined. The circumscribed rectangle region is input into a pre-trained cap and bottle body classifier to remove the cap part and the label region to obtain a first image. The gray scale image is traversed, and the region with a gray scale value greater than a first gray scale threshold is taken as a high light region, and the region with a gray scale value less than a second gray scale threshold is taken as a low light region. The first gray scale threshold is greater than the second gray scale threshold. The high light region and the low light region are removed from the first image to obtain a second image. The second image is traversed, and a preset number of effective pixel points are uniformly selected. Each effective pixel point is taken as a center, and a preset number of data cubes are selected according to the reflectivity data and a window with a preset size. The data cubes are combined to obtain target data.
[0074] Exemplarily, the SAM segmentation algorithm is used to segment the pseudo-color image corresponding to the plastic article to be identified to obtain an overall mask template (as shown in Figure 3 , and Figure 3 a bottle cap mask template corresponding to the plastic article to be identified. Figure 4 and Figure 5 , and Figure 4 a bottle cap mask template corresponding to the plastic article to be identified. Figure 5 , and ) and width, height). The partial mask template contains the cap, label and bottle body of the plastic object. The contour detection is performed on the partial mask template, and the circumscribed rectangle is calculated. The circumscribed rectangle region in the pseudo-color map is cropped (as shown in Figure 6 and Figure 7 , Figure 6 is the circumscribed rectangle region of the cap in the color map, Figure 7 is the circumscribed rectangle region of the label in the color map), and is input into the trained cap bottle body classifier to identify the category of the partial mask template. The cap and label regions are removed, and only the bottle body region of each plastic object is retained, i.e., the first image. The mean value and the standard deviation of the gray value of the remaining plastic region are calculated for the first image. If the gray value is greater than (i.e., the first gray threshold), it is judged to be a highlight region, where is an adaptive adjustment factor, which can be set to 1.2. If the gray value is less than (i.e., the second gray threshold), it is judged to be a low light region, where is an adaptive adjustment factor, which can be set to 1.5. After removing the highlight and low light regions, only the remaining bottle body region of each plastic object is retained, i.e., the second image. The second image is traversed, and effective pixel points are uniformly selected, for example, is set to 128. A data cube of a 25x25 window region is selected with the pixel point as the center. If the window boundary exceeds the image boundary, zero padding is performed. The 128 window region data cubes are grouped into a batch data, i.e., the target data.
[0075] In S104, the target data is input into the hyperspectral classification model to obtain the material identification result of the plastic object to be identified.
[0076] Optionally, the target data can be input into the hyperspectral classification model to obtain the identification result corresponding to each data cube. The majority voting is performed on the identification result corresponding to each data cube to obtain the material identification result of the plastic object to be identified.
[0077] For example, first, the number of times each category (PET, HDPE, PVC, PPSU, PP) appears in the 128 results is counted. If the number of times of a certain category exceeds half (≥65 times), it is directly determined that the plastic object belongs to this category. If there are multiple categories with the same number of times and the maximum value, the sum of the confidence degrees corresponding to these categories is further compared, and the category with the highest confidence degree is selected as the final identification result.
[0078] The plastic material identification method in the above embodiment first acquires an original hyperspectral image of a plastic object to be identified, and performs black and white correction on the original hyperspectral image to obtain a reflectivity image; then extracts a gray scale image, a pseudo-color image and reflectivity data of a target region from the reflectivity image; then performs segmentation and selection processing on the original hyperspectral image based on the gray scale image, the pseudo-color image and the reflectivity data of the target region to obtain target data; and finally inputs the target data into a hyperspectral classification model to obtain a material identification result of the plastic object to be identified. By extracting the hyperspectral image and then performing segmentation and selection on the hyperspectral image, the interference part in the hyperspectral image is removed, and then the material identification is performed based on the hyperspectral classification model, which avoids the damage to the plastic, reduces the cost of plastic material identification, and increases the accuracy of plastic material identification.
[0079] In order to more fully display the present scheme, the present embodiment gives an optional method of a plastic material identification method, and the specific method comprises:
[0080] S201, acquiring an original hyperspectral image of a plastic object to be identified.
[0081] S202, collecting dark background hyperspectral data and white background hyperspectral data corresponding to the original hyperspectral image.
[0082] S203, performing black and white correction on the original hyperspectral image according to the dark background hyperspectral data and the white background hyperspectral data to obtain a reflectivity image.
[0083] S204, multiplying each pixel in the reflectivity image with a preset parameter, and taking the average value in the spectral channel to obtain a gray scale image corresponding to the original hyperspectral image.
[0084] S205, extracting reflectivity data of the reflectivity image, and converting the reflectivity data of the three preset wave bands into a pseudo-color image.
[0085] S206, selecting a target region from the gray scale image corresponding to the original hyperspectral image, and determining the gray scale image, the pseudo-color image and the reflectivity data corresponding to the target region.
[0086] S207, using a SAM segmentation algorithm to segment the pseudo-color image to obtain a partial mask plate of the plastic object to be identified.
[0087] S208, performing contour detection on the partial mask plate, and calculating a circumscribed rectangle of the partial mask plate.
[0088] S209, determining a circumscribed rectangle region of the circumscribed rectangle in the pseudo-color image.
[0089] S210, inputting the circumscribed rectangle region into a pre-trained bottle cap and bottle body classifier to remove the bottle cap part and the label region to obtain a first image.
[0090] S211, traverse the gray scale image, and regard a region with a gray scale value greater than a first gray scale threshold value as a highlight region and regard a region with a gray scale value less than a second gray scale threshold value as a low light region.
[0091] The first gray scale threshold value is greater than the second gray scale threshold value.
[0092] S212, remove the highlight region and the low light region from the first image to obtain a second image.
[0093] S213, traverse the second image, and uniformly select a preset number of effective pixel points.
[0094] S214, select a preset number of data cubes according to the reflectivity data and a window of a preset size, with each effective pixel point as a center.
[0095] S215, combine the data cubes to obtain target data.
[0096] S216, input the target data into a hyperspectral classification model to obtain an identification result corresponding to each data cube.
[0097] S217, perform majority voting on the identification results corresponding to the data cubes to obtain a material identification result of the plastic object to be identified.
[0098] The specific process of S201-S217 can be referred to the description of the method embodiments, and the implementation principle and technical effects are similar, and thus will not be described herein again.
[0099] Based on the same inventive concept, the embodiments of the present application also provide a plastic material identification device for implementing the plastic material identification method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, and thus the specific limitations in one or more plastic material identification device embodiments provided below can be referred to the limitations of the plastic material identification method described above, and thus will not be described herein again.
[0100] In one embodiment, as shown in Figure 8 a plastic material identification device is provided, which comprises:
[0101] An image acquisition module 20 is configured to acquire an original hyperspectral image of a plastic object to be identified, and perform black and white correction on the original hyperspectral image to obtain a reflectivity image.
[0102] An image extraction module 21 is configured to extract a gray scale image, a pseudo-color image and reflectivity data of a target region from the reflectivity image.
[0103] The data acquisition module 22 is configured to perform segmentation and selection processing on the original hyperspectral image based on the grayscale image, the false color image, and the reflectivity data of the target region, to obtain target data.
[0104] The material identification module 23 is configured to input the target data into a hyperspectral classification model, to obtain a material identification result of the plastic object to be identified.
[0105] In another embodiment, as shown in Figure 9 the data acquisition module 22 in the above Figure 8 includes:
[0106] The first removal unit 220 is configured to perform segmentation on the false color image using a SAM segmentation algorithm, to remove the cap portion and the label region in the original hyperspectral image, to obtain a first image.
[0107] The second removal unit 221 is configured to remove the high-light region and the low-light region in the first image based on the grayscale image, to obtain a second image.
[0108] The data acquisition unit 222 is configured to select target data from the second image based on the reflectivity data using a preset window.
[0109] In another embodiment, the first removal unit 220 in the above Figure 9 is specifically configured to perform segmentation on the false color image using a SAM segmentation algorithm, to obtain a partial mask template of the plastic object to be identified; perform contour detection on the partial mask template, and calculate a circumscribed rectangle of the partial mask template; determine a circumscribed rectangle region of the circumscribed rectangle in the false color image; and input the circumscribed rectangle region into a pre-trained cap and bottle body classifier, to remove the cap portion and the label region, to obtain the first image.
[0110] In another embodiment, the second removal unit 221 in the above Figure 9 is specifically configured to traverse the grayscale image, to regard a region with a grayscale value greater than a first grayscale threshold value as a high-light region, and to regard a region with a grayscale value less than a second grayscale threshold value as a low-light region; the first grayscale threshold value is greater than the second grayscale threshold value; and the high-light region and the low-light region are removed from the first image, to obtain the second image.
[0111] In another embodiment, the data acquisition unit 222 in the above Figure 9 is specifically configured to traverse the second image, to uniformly select a preset number of effective pixel points; to select a preset number of data cubes according to the reflectivity data and a window with a preset size, with each effective pixel point as a center; and to combine the data cubes, to obtain the target data.
[0112] In another embodiment, the data acquisition unit 222 in the above Figure 8The material identification module 23 is specifically used for: inputting target data into the hyperspectral classification model to obtain the identification results corresponding to each data cube; and performing a majority vote on the identification results corresponding to each data cube to obtain the material identification results of the plastic item to be identified.
[0113] In another embodiment, the above Figure 8 The image extraction module 21 is specifically used for: multiplying each pixel in the reflectance image with preset parameters, and taking the average value in the spectral channel to obtain the grayscale image corresponding to the original hyperspectral image; extracting the reflectance data of the reflectance image, and selecting the spectrum of three preset bands from the reflectance data to convert it into a pseudo-color image; selecting a target area from the grayscale image corresponding to the original hyperspectral image, and determining the grayscale image, pseudo-color image and reflectance data corresponding to the target area.
[0114] In another embodiment, the above Figure 8 The image acquisition module 20 is specifically used for: acquiring dark background hyperspectral data and white background hyperspectral data corresponding to the original hyperspectral image; performing black and white correction on the original hyperspectral image based on the dark background hyperspectral data and white background hyperspectral data to obtain a reflectance image.
[0115] This application also provides an electronic device, in some embodiments, referring to... Figure 10 As shown, the electronic device 700 includes an input unit 710, a memory 720, a processor 730, and an output unit 740. The memory 720 stores program instructions that can be executed on the processor 730. The processor 730 can execute the plastic material identification method and / or technical solution based on the foregoing embodiments by calling the program instructions. The electronic device 700 can be a mobile terminal device such as a mobile phone or a computer.
[0116] Furthermore, embodiments of this application also provide a computer-readable storage medium for storing a computer program that performs a plastic material identification method. For example, computer program instructions, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. The program instructions that invoke the methods of this application may be stored in a fixed or removable storage medium, and / or transmitted via data streams in broadcast or other signal carrying media, and / or stored in a storage medium that operates according to the program instructions.
[0117] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be realized by universal computing devices, which can be centralized on a single computing device or distributed on a network composed of multiple computing devices, and optionally, they can be realized by program codes executable by the computing devices, so that they can be stored in storage devices and executed by the computing devices, or they can be respectively manufactured into individual integrated circuit modules, or multiple modules or steps among them can be manufactured into a single integrated circuit module to realize. Thus, the present application is not limited to any specific combination of hardware and software.
[0118] The technical features of the above embodiments can be integrated in any manner. In order to make the description simple, all possible integrations of the technical features in the above embodiments are not described, however, as long as the integration of the technical features does not exist contradictions, it should be considered as the scope of the present application.
[0119] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
Claims
1. A method for identifying plastic materials, characterized in that, The method includes: Acquire the original hyperspectral image of the plastic item to be identified, and perform black and white correction on the original hyperspectral image to obtain a reflectance image; Extracting the grayscale image, pseudocolor image, and reflectance data of the target region from the reflectance image includes: multiplying each pixel in the reflectance image with a preset parameter and averaging the results across the spectral channels to obtain the grayscale image corresponding to the original hyperspectral image; extracting the reflectance data from the reflectance image and converting the spectra of three preset bands from the reflectance data into a pseudocolor image; selecting the target region from the grayscale image corresponding to the original hyperspectral image and determining the grayscale image, pseudocolor image, and reflectance data corresponding to the target region. Extract the grayscale image, pseudocolor image, and reflectance data of the target region from the reflectance image; Based on the grayscale image, pseudocolor image and reflectance data of the target region, the original hyperspectral image is segmented and selected to obtain the target data; The original hyperspectral image is segmented and selected based on the grayscale image, pseudocolor image, and reflectance data of the target region to obtain target data. This includes: segmenting the pseudocolor image using the SAM segmentation algorithm to remove the bottle cap portion and label area from the original hyperspectral image to obtain a first image; removing highlight and low-light areas from the first image based on the grayscale image to obtain a second image; and selecting the target data from the second image using a preset window based on the reflectance data. Based on the reflectance data, target data is selected from the second image using a preset window, including: traversing the second image and uniformly selecting a preset number of valid pixels; selecting a preset number of data cubes centered on each valid pixel, based on the reflectance data and a window of a preset size; and combining the data cubes to obtain the target data. The target data is input into the hyperspectral classification model to obtain the material identification result of the plastic item to be identified; The process of inputting the target data into a hyperspectral classification model to obtain the material identification result of the plastic item to be identified includes: inputting the target data into a hyperspectral classification model to obtain the identification result corresponding to each data cube; and performing a majority vote on the identification results corresponding to each data cube to obtain the material identification result of the plastic item to be identified.
2. The plastic material identification method as described in claim 1, characterized in that, The pseudo-color image is segmented using the SAM segmentation algorithm to remove the bottle cap portion and label region from the original hyperspectral image, resulting in a first image, including: The pseudo-color image is segmented using the SAM segmentation algorithm to obtain a partial mask template of the plastic item to be identified; The contour of the partial mask template is detected, and the bounding rectangle of the partial mask template is calculated; Determine the bounding rectangle region of the bounding rectangle in the pseudo-color image; The circumscribed rectangular region is input into a pre-trained bottle cap and body classifier, and the bottle cap portion and label region are removed to obtain the first image.
3. The plastic material identification method as described in claim 1, characterized in that, Based on the grayscale image, highlight and low-light regions are removed from the first image to obtain a second image, including: Traverse the grayscale image, and designate regions with grayscale values greater than a first grayscale threshold as highlight regions and regions with grayscale values less than a second grayscale threshold as low-light regions; the first grayscale threshold is greater than the second grayscale threshold. The highlight and shadow areas are removed from the first image to obtain the second image.
4. The plastic material identification method as described in claim 1, characterized in that, The original hyperspectral image is subjected to black and white correction to obtain a reflectance image, including: Collect hyperspectral data with a dark background and hyperspectral data with a white background corresponding to the original hyperspectral image; The original hyperspectral image is black and white corrected based on the dark background hyperspectral data and the white background hyperspectral data to obtain a reflectance image.
5. A plastic material identification device, characterized in that, The device includes: The image acquisition module is used to acquire the original hyperspectral image of the plastic item to be identified, and to perform black and white correction on the original hyperspectral image to obtain a reflectance image; Extracting the grayscale image, pseudocolor image, and reflectance data of the target region from the reflectance image includes: multiplying each pixel in the reflectance image with a preset parameter and averaging the results across the spectral channels to obtain the grayscale image corresponding to the original hyperspectral image; extracting the reflectance data from the reflectance image and converting the spectra of three preset bands from the reflectance data into a pseudocolor image; selecting the target region from the grayscale image corresponding to the original hyperspectral image and determining the grayscale image, pseudocolor image, and reflectance data corresponding to the target region. The image extraction module is used to extract the grayscale image, pseudocolor image and reflectance data of the target area from the reflectance image; The data acquisition module is used to segment and select the original hyperspectral image based on the grayscale image, pseudocolor image and reflectance data of the target area to obtain target data; The original hyperspectral image is segmented and selected based on the grayscale image, pseudocolor image, and reflectance data of the target region to obtain target data. This includes: segmenting the pseudocolor image using the SAM segmentation algorithm to remove the bottle cap portion and label area from the original hyperspectral image to obtain a first image; removing highlight and low-light areas from the first image based on the grayscale image to obtain a second image; and selecting the target data from the second image using a preset window based on the reflectance data. Based on the reflectance data, target data is selected from the second image using a preset window, including: traversing the second image and uniformly selecting a preset number of valid pixels; selecting a preset number of data cubes centered on each valid pixel, based on the reflectance data and a window of a preset size; and combining the data cubes to obtain the target data. The material identification module is used to input the target data into the hyperspectral classification model to obtain the material identification result of the plastic item to be identified; The process of inputting the target data into a hyperspectral classification model to obtain the material identification result of the plastic item to be identified includes: inputting the target data into a hyperspectral classification model to obtain the identification result corresponding to each data cube; and performing a majority vote on the identification results corresponding to each data cube to obtain the material identification result of the plastic item to be identified.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the plastic material identification method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Plastic PET identification method based on hyperspectral technology
CN115684034A
Hyperspectral plastic garbage material rapid classification method and device and storage medium
CN115984632A