Plastic material identification method, device and 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 of existing plastic material identification methods are solved, achieving efficient and accurate plastic material identification.
Patent Information
- Application Number
- CN202511377437.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-09-25
AI Technical Summary
Existing methods for identifying plastic materials suffer from low accuracy, high cost, expensive equipment, and high destructiveness, making them difficult to popularize, especially in small and medium-sized application scenarios.
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.
It improves the accuracy of plastic material identification, reduces identification costs, is suitable for small and medium-sized applications, and avoids damage to plastics.
Smart Images

Figure CN120877128A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and more specifically to a method, apparatus, device, and readable storage medium for identifying plastic materials. Background Technology
[0002] Currently, the main technical means for identifying plastic materials include spectroscopic analysis and physical / chemical detection methods. Among these, spectroscopic analysis is the most widely used, with near-infrared spectroscopy (NIR) and mid-infrared spectroscopy (MIR) being typical examples. This method identifies the type of plastic by acquiring the reflectance or transmittance characteristics of the material at different wavelengths and comparing them with a known spectral library. Its advantages are that it is non-destructive and rapid, suitable for online detection, but its limitations are also quite obvious: the differences in spectral curves between different plastics are sometimes not significant, especially for plastics containing fillers, pigments, or composite modifications, where spectral features easily overlap, leading to a decrease in identification accuracy; at the same time, spectrometers are expensive, and equipment maintenance costs are high, limiting their widespread adoption in small- to medium-scale applications.
[0003] Physical / chemical testing methods, such as density methods, solvent methods, and combustion methods, determine the type of plastic through physical parameters or combustion products. Although these methods are intuitive and low-cost, they are mostly destructive tests and have low efficiency, making them unsuitable for large-scale, real-time identification.
[0004] In summary, current methods for identifying plastic materials still have many problems. Therefore, there is an urgent need for a method that can overcome these shortcomings. Summary of the Invention
[0005] The purpose of this invention is to provide a method, apparatus, device, and readable storage medium for identifying plastic materials. By extracting hyperspectral images, segmenting and selecting the hyperspectral images to remove interference, and then identifying the material based on a hyperspectral classification model, this method avoids damage to the plastic, reduces the cost of plastic material identification, and increases the accuracy of plastic material identification.
[0006] To achieve the above objectives, the present invention provides the following technical solution: In a first aspect, the present invention provides a method for identifying plastic materials, the method comprising: 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 the reflectance image; Extract the grayscale image, pseudocolor image, and reflectance data of the target region from the reflectance image; The original hyperspectral image is segmented and selected based on the grayscale image, pseudocolor image and reflectance data of the target region to obtain the target data. The target data is input into the hyperspectral classification model to obtain the material identification results of the plastic items to be identified.
[0007] In some embodiments, 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, including: The SAM segmentation algorithm is used to segment the pseudo-color image, and the bottle cap and label regions in the original hyperspectral image are removed to obtain the first image; Based on the grayscale image, the highlight and low-light regions in the first image are removed to obtain the second image; Based on reflectance data, target data is selected from the second image using a preset window.
[0008] In some embodiments, the SAM segmentation algorithm is used to segment the pseudo-color image, removing the bottle cap portion and label region from the original hyperspectral image to obtain a first image, including: The SAM segmentation algorithm is used to segment the pseudo-color image to obtain a partial mask template of the plastic item to be identified; Perform contour detection on a portion of the mask template and calculate the bounding rectangle of the portion of the mask template; Determine the bounding rectangle region in the pseudocolor image; The bounding rectangular region is input into a pre-trained bottle cap and body classifier, and the bottle cap and label regions are removed to obtain the first image.
[0009] In some embodiments, based on a grayscale image, highlight and low-light regions are removed from a first image to obtain a second image, including: Traverse the grayscale image, designating 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.
[0010] In some embodiments, selecting target data from a second image using a preset window based on reflectance data includes: Traverse the second image and uniformly select a preset number of valid pixels; Centered on each valid pixel, a preset number of data cubes are selected based on reflectivity data and a window of a preset size; The target data is obtained by combining the various data cubes.
[0011] In some embodiments, the target data is input into a hyperspectral classification model to obtain the material identification result of the plastic article to be identified, including: The target data is input into the hyperspectral classification model to obtain the recognition results corresponding to each data cube; A majority vote is conducted on the recognition results corresponding to each data cube to obtain the material recognition result of the plastic item to be identified.
[0012] In some embodiments, extracting the grayscale image, pseudocolor image, and reflectance data of the target region from the reflectance image includes: Each pixel in the reflectance image is multiplied with a preset parameter, and the average value is taken in the spectral channel to obtain the grayscale image corresponding to the original hyperspectral image. Extract reflectance data from the reflectance image, and select three preset spectral bands from the reflectance data to convert them into a pseudo-color image; Select the target region from the grayscale image corresponding to the original hyperspectral image, and determine the grayscale image, pseudocolor image and reflectance data corresponding to the target region.
[0013] In some embodiments, the original hyperspectral image is subjected to black-and-white correction to obtain a reflectance image, including: Collect hyperspectral data with dark background and hyperspectral data with white background corresponding to the original hyperspectral images; The original hyperspectral image was black and white corrected based on the hyperspectral data with dark background and white background to obtain the reflectance image.
[0014] Secondly, the present invention also provides a plastic material identification device, the device comprising: 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; 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 the target data. The material identification module is used to input target data into the hyperspectral classification model to obtain the material identification results of the plastic items to be identified.
[0015] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the plastic material identification method provided in the first aspect.
[0016] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the plastic material identification method provided in the first aspect.
[0017] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the plastic material identification method provided in the first aspect.
[0018] The beneficial effects of this invention are as follows: The plastic material identification method provided in this invention first acquires the original hyperspectral image of the plastic item to be identified, and performs black-and-white correction on the original hyperspectral image to obtain a reflectance image; then, it extracts the grayscale image, pseudo-color image, and reflectance data of the target area from the reflectance image; then, it segments and selects the original hyperspectral image based on the grayscale image, pseudo-color image, and reflectance data of the target area to obtain target data; finally, it inputs the target data into a hyperspectral classification model to obtain the material identification result of the plastic item to be identified. By extracting the hyperspectral image, then segmenting and selecting the hyperspectral image, the interference parts in the hyperspectral image are removed, and then material identification is performed based on the hyperspectral classification model. This method avoids damage to the plastic, reduces the cost of plastic material identification, and increases the accuracy of plastic material identification.
[0019] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, the preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings. Attached Figure Description
[0020] Figure 1 This is a schematic flowchart illustrating a plastic material identification method according to an embodiment of the present invention; Figure 2 This is a pseudo-color image of the target area shown in an embodiment of the present invention; Figure 3 This is an overall mask template corresponding to the plastic article to be identified, as shown in one embodiment of the present invention; Figure 4 This is a bottle cap mask template corresponding to the plastic article to be identified, as shown in one embodiment of the present invention; Figure 5 This is a label mask template corresponding to the plastic article to be identified, as shown in one embodiment of the present invention; Figure 6 The outer rectangular area of the bottle cap shown in the color diagram is an embodiment of the present invention; Figure 7 The label shown in one embodiment of the present invention is located in the bounding rectangular area of the color image; Figure 8 This is a schematic diagram of the structure of a plastic material identification device according to an embodiment of the present invention; Figure 9 This is a schematic diagram of another plastic material identification device according to an embodiment of the present invention; Figure 10 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation
[0021] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] It should be noted that references to "an embodiment," "embodiment," "example embodiment," etc., in this specification refer to the described embodiment including specific features, structures, or characteristics; however, not every embodiment must include these specific features, structures, or characteristics. Furthermore, such expressions do not refer to the same embodiment. Moreover, when describing specific features, structures, or characteristics in conjunction with embodiments, whether or not explicitly described, it is indicated that incorporating such features, structures, or characteristics into other embodiments is within the knowledge of those skilled in the art.
[0023] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0024] In some embodiments, such as Figure 1 As shown, a method for identifying plastic materials is provided, the specific method including: S101, 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.
[0025] Specifically, a hyperspectral camera can be used to photograph the plastic item to be identified, obtaining the original hyperspectral image of the item.
[0026] Optionally, the process of performing black-and-white correction on the original hyperspectral image to obtain a reflectance image includes: 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.
[0027] Specifically, the hyperspectral image can be acquired by covering the lens cap of the hyperspectral camera with dark background hyperspectral data of the plastic object to be identified, and then acquiring white background hyperspectral data of the plastic object with the lens cap open. The original hyperspectral image is then subjected to black-and-white correction based on the dark and white background hyperspectral data to obtain the reflectance image. The specific calculation formula is as follows: ; in, This is the reflectance image after black and white correction. The original hyperspectral image, A hyperspectral image with a white background. This is a hyperspectral image against a dark background.
[0028] S102, extract the grayscale image, pseudocolor image and reflectance data of the target area from the reflectance image.
[0029] Optionally, each pixel in the reflectance image is multiplied by a preset parameter, and the average value is taken across the spectral channels to obtain the grayscale image corresponding to the original hyperspectral image; reflectance data is extracted from the reflectance image, and the spectra of three preset bands are selected from the reflectance data to convert it into a pseudo-color image; a target region is selected from the grayscale image corresponding to the original hyperspectral image, and the corresponding grayscale image and pseudo-color image (e.g., ...) are determined. Figure 2 As shown, Figure 2 (A pseudo-color map of the target area) and reflectance data.
[0030] For example, the preset parameter can be set to 255. Each pixel in the reflectance image is multiplied by 255, and then the average value is taken in the spectral channel dimension to obtain the grayscale image corresponding to the original hyperspectral image. The three preset bands can be 50, 100, and 150. The spectra of the 50, 100, and 150 bands are selected from the reflectance data and converted into pseudocolor images. The target area can be manually marked in the grayscale image, and the grayscale image and pseudocolor image corresponding to the target area can be extracted from the grayscale image and pseudocolor image, and the reflectance data corresponding to the target area can be determined.
[0031] S103, 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.
[0032] Optionally, the SAM segmentation algorithm can be used to segment the pseudo-color image, removing the bottle cap and label areas from the original hyperspectral image to obtain the first image; based on the grayscale image, the highlight and low-light areas in the first image are removed to obtain the second image; based on the reflectance data, the target data is selected from the second image using a preset window.
[0033] Specifically, the SAM segmentation algorithm is used to segment the pseudo-color image to obtain a partial mask template of the plastic item to be identified; contour detection is performed on the partial mask template, and the bounding rectangle of the partial mask template is calculated; the bounding rectangle region of the bounding rectangle in the pseudo-color image is determined; the bounding rectangle region is input into a pre-trained bottle cap and bottle body classifier to remove the bottle cap and label regions, resulting in the first image; the grayscale image is traversed, and regions with grayscale values greater than a first grayscale threshold are designated as highlight regions, and regions with grayscale values less than a second grayscale threshold are designated as low-light regions, provided the first grayscale threshold is greater than the second grayscale threshold; the highlight and low-light regions are removed from the first image to obtain the second image; the second image is traversed, and a preset number of effective pixels are selected uniformly; with each effective pixel as the center, a preset number of data cubes are selected based on reflectance data and a window of a preset size; the data cubes are combined to obtain the target data.
[0034] For example, the SAM segmentation algorithm is used to segment the pseudo-color image corresponding to the plastic item to be identified, obtaining the overall mask template corresponding to each plastic item to be identified (e.g., Figure 3 As shown, Figure 3 For the overall mask template corresponding to the plastic item to be identified) and partial mask templates (such as...) Figure 4 and Figure 5 As shown, Figure 4 For the bottle cap template corresponding to the plastic item to be identified, Figure 5 (This is the label mask template corresponding to the plastic item to be identified). The overall mask template is the plastic item itself; contour detection is performed, and its bounding rectangle is calculated as the position coordinates of the plastic item (the coordinates of the center point of the bounding rectangle are...). (and width, height). Partial mask templates represent the bottle cap, label, and bottle body of a plastic item. The partial mask template is subjected to contour detection, its bounding rectangle is calculated, and the bounding rectangle region is cropped from the pseudo-color image (e.g., width, height). Figure 6 and Figure 7 As shown, Figure 6 This represents the bounding rectangle of the bottle cap in the color image. Figure 7 The bounding rectangle of the label in the color image is input into a trained bottle cap and bottle body classifier to identify the category of a portion of the mask. The bottle cap and label areas are removed, leaving only the bottle body area for each plastic item, i.e., the first image. The average grayscale value of the remaining plastic area in the first image is then calculated. and standard deviation Iterate through the grayscale values of the remaining plastic area. If the grayscale value is greater than... (i.e., the first grayscale threshold) is then identified as a highlight area, where This is an adaptive adjustment factor and can be set to 1.2. If the grayscale value is less than... (i.e., the second grayscale threshold) is then identified as a low-light region, where As an adaptive adjustment factor, it can be set to 1.5. After removing highlight and shadow areas, only the remaining bottle body area of each plastic item is retained, i.e., the second image; the second image is then iterated through, and the selection is uniform. Valid pixels, for example Set to 128. A 25x25 data cube is selected centered on this pixel. If the window boundaries exceed the image boundaries, zero-padding is applied. These 128 window data cubes are then grouped into a batch of data, which is the target data.
[0035] S104. Input the target data into the hyperspectral classification model to obtain the material identification result of the plastic item to be identified.
[0036] Optionally, the target data can be input into a hyperspectral classification model to obtain the recognition results corresponding to each data cube; a majority vote can be performed on the recognition results corresponding to each data cube to obtain the material recognition result of the plastic item to be identified.
[0037] For example, firstly, the frequency of each category (PET, HDPE, PVC, PPSU, PP) in the 128 results is counted. If a category appears more than half the time (≥65 times), the plastic item is directly determined to belong to this category. If multiple categories have the same frequency and the highest frequency, the sum of the confidence scores corresponding to these categories is further compared, and the category with the highest confidence score is selected as the final identification result.
[0038] The plastic material identification method in the above embodiments first acquires the original hyperspectral image of the plastic item to be identified, and performs black-and-white correction on the original hyperspectral image to obtain a reflectance image; then, it extracts the grayscale image, pseudo-color image, and reflectance data of the target area from the reflectance image; next, it segments and selects the original hyperspectral image based on the grayscale image, pseudo-color image, and reflectance data of the target area to obtain target data; finally, it inputs the target data into a hyperspectral classification model to obtain the material identification result of the plastic item to be identified. By extracting the hyperspectral image, then segmenting and selecting the hyperspectral image, interference parts in the hyperspectral image are removed, and then material identification is performed based on the hyperspectral classification model. This method avoids damage to the plastic, reduces the cost of plastic material identification, and increases the accuracy of plastic material identification.
[0039] To more comprehensively demonstrate this solution, this embodiment provides an optional method for identifying plastic materials, which includes: S201, Obtain the original hyperspectral image of the plastic item to be identified.
[0040] S202, acquires hyperspectral data with dark background and hyperspectral data with white background corresponding to the original hyperspectral image.
[0041] S203. Based on the hyperspectral data with dark background and hyperspectral data with white background, perform black and white correction on the original hyperspectral image to obtain the reflectance image.
[0042] S204 calculates the product of each pixel in the reflectance image with preset parameters and takes the average value in the spectral channel to obtain the grayscale image corresponding to the original hyperspectral image.
[0043] S205, extract the reflectance data of the reflectance image, and select three preset spectral bands from the reflectance data to convert them into a pseudo-color image.
[0044] S206, Select the target region from the grayscale image corresponding to the original hyperspectral image, and determine the grayscale image, pseudocolor image and reflectance data corresponding to the target region.
[0045] S207. The SAM segmentation algorithm is used to segment the pseudo-color image to obtain a partial mask template of the plastic item to be identified.
[0046] S208 performs contour detection on a portion of the mask template and calculates the bounding rectangle of the portion of the mask template.
[0047] S209, Determine the bounding rectangle region in the pseudocolor image.
[0048] S210, input the circumscribed rectangular region into the pre-trained bottle cap and body classifier, remove the bottle cap part and the label region, and obtain the first image.
[0049] S211, Traverse the grayscale image, and designate areas with grayscale values greater than the first grayscale threshold as highlight areas and areas with grayscale values less than the second grayscale threshold as low-light areas.
[0050] The first grayscale threshold is greater than the second grayscale threshold.
[0051] S212, Remove the highlight and low-light areas from the first image to obtain the second image.
[0052] S213, traverse the second image and uniformly select a preset number of valid pixels.
[0053] S214: Centered on each valid pixel, select a preset number of data cubes based on reflectivity data and a window of preset size.
[0054] S215, combine the various data cubes to obtain the target data.
[0055] S216, Input the target data into the hyperspectral classification model to obtain the recognition results corresponding to each data cube.
[0056] S217, perform a majority vote on the recognition results corresponding to each data cube to obtain the material recognition result of the plastic item to be identified.
[0057] The specific processes of S201-S217 described above can be found in the description of the above method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.
[0058] Based on the same inventive concept, this application also provides a plastic material identification device for implementing the aforementioned plastic material identification method. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more embodiments of the plastic material identification device provided below can be found in the limitations of the plastic material identification method described above, and will not be repeated here.
[0059] In one embodiment, such as Figure 8 As shown, a plastic material identification device is provided, the device comprising: The image acquisition module 20 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; Image extraction module 21 is used to extract grayscale image, pseudocolor image and reflectance data of target area from reflectance image; Data acquisition module 22 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 material recognition module 23 is used to input the target data into the hyperspectral classification model to obtain the material recognition result of the plastic item to be identified.
[0060] In another embodiment, such as Figure 9 As shown above, Figure 8 The data acquisition module 22 in the middle includes: The first removal unit 220 is used to segment the pseudo-color image using the SAM segmentation algorithm, remove the bottle cap portion and label region from the original hyperspectral image, and obtain the first image; The second removal unit 221 is used to remove the highlight area and the low-light area in the first image based on the grayscale image to obtain the second image; The data acquisition unit 222 is used to select target data from the second image based on reflectance data using a preset window.
[0061] In another embodiment, the above Figure 9The first removal unit 220 is specifically used for: segmenting the pseudo-color image using the SAM segmentation algorithm to obtain a partial mask template of the plastic item to be identified; performing contour detection on the partial mask template and calculating the bounding rectangle of the partial mask template; determining the bounding rectangle region in the pseudo-color image; inputting the bounding rectangle region into a pre-trained bottle cap and bottle body classifier to remove the bottle cap part and label region to obtain the first image.
[0062] In another embodiment, the above Figure 9 The second removal unit 221 is specifically used to: traverse the grayscale image, take the region with grayscale value greater than the first grayscale threshold as the highlight region, and take the region with grayscale value less than the second grayscale threshold as the low-light region; the first grayscale threshold is greater than the second grayscale threshold; remove the highlight region and the low-light region from the first image to obtain the second image.
[0063] In another embodiment, the above Figure 9 The data acquisition unit 222 is specifically used for: traversing the second image and uniformly selecting a preset number of valid pixels; taking each valid pixel as the center and selecting a preset number of data cubes based on reflectance data and a window of a preset size; and combining the data cubes to obtain the target data.
[0064] In another embodiment, the above Figure 8 The 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.
[0065] 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.
[0066] 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.
[0067] This application also provides an electronic device, in some embodiments, referring to... Figure 10As 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.
[0068] 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.
[0069] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device, or fabricating them separately as individual integrated circuit modules, or fabricating multiple modules or steps as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0070] The technical features of the above embodiments can be arbitrarily integrated. For the sake of brevity, not all possible integrations of the technical features in the above embodiments are described. However, as long as the integration of these technical features does not contradict each other, they should be considered to be within the scope of this specification.
[0071] The above embodiments merely illustrate several implementation methods of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by 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; Extract the grayscale image, pseudocolor image, and reflectance data of the target region from the reflectance image; The original hyperspectral image is segmented and selected based on the grayscale image, pseudocolor image and reflectance data of the target region 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.
2. The plastic material identification method as described in claim 1, characterized in that, 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, including: 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. Based on the grayscale image, the highlight and low-light regions in the first image are removed to obtain the second image; Based on the reflectance data, target data is selected from the second image using a preset window.
3. The plastic material identification method as described in claim 2, 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.
4. The plastic material identification method as described in claim 2, 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.
5. The plastic material identification method as described in claim 2, characterized in that, Based on the reflectance data, target data is selected from the second image using a preset window, including: Traverse the second image and uniformly select a preset number of valid pixels; Centered on each valid pixel, a preset number of data cubes are selected based on reflectivity data and a window of a preset size; The target data is obtained by combining the various data cubes.
6. The plastic material identification method as described in claim 5, characterized in that, The target data is input into a hyperspectral classification model to obtain the material identification result of the plastic item to be identified, including: The target data is input into a hyperspectral classification model to obtain the recognition results corresponding to each data cube; A majority vote is performed on the recognition results corresponding to each of the data cubes to obtain the material recognition result of the plastic item to be identified.
7. The plastic material identification method as described in claim 1, characterized in that, Extracting the grayscale image, pseudocolor image, and reflectance data of the target region from the reflectance image includes: Each pixel in the reflectance image is multiplied with a preset parameter, and the average value is taken in the spectral channel to obtain the grayscale image corresponding to the original hyperspectral image. Extract the reflectance data from the reflectance image, and select three preset spectral bands from the reflectance data to convert them into a pseudo-color image; Select a target region from the grayscale image corresponding to the original hyperspectral image, and determine the grayscale image, pseudocolor image, and reflectance data corresponding to the target region.
8. 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.
9. 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; 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 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.
10. 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 8.
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
Plastic bottle target detection method and system, storage medium and equipment
CN118229660A
Data intelligent processing method of spectral analysis platform
CN118521836A
System and method for hyperspectral image processing to identify object
US20180365820A1