Metal resource recovery weighing management system based on Internet

By combining image processing and texture analysis, the problem of identification and classification in the management of metal sample recycling has been solved, achieving high-quality repair and accurate identification, and improving the stability and efficiency of the system.

CN120976068APending Publication Date: 2025-11-18KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511079034.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-02
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately identify and classify metal samples during recovery and weighing management, leading to high false detection rates, increased operating costs, and increased system stability and deployment difficulty. Furthermore, the lack of quantitative evaluation of repair quality negatively impacts recovery efficiency.

Method used

The contaminated areas are identified by the image processing module. The contaminated connected regions are corrected by combining wavelet transform and texture energy analysis. The images are fused using a metal texture sample library. Multidimensional scoring is used to ensure the quality of the restored images. Finally, classification and weighing are performed by computer equipment.

Benefits of technology

It enables high-quality repair and identification of metal samples, ensuring the stability and accuracy of subsequent recycling management, reducing false detection rate, and improving the robustness and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976068A_ABST
    Figure CN120976068A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of metal resource recovery, in particular to a metal resource recovery weighing management system based on the Internet. Polluted connected areas are positioned through morphological processing, a metal texture sample library is introduced, most similar texture image cutting area samples are found through depth feature extraction and sample matching, image fusion and size adaptation are carried out, and visual mutation caused by inconsistent boundary textures is avoided. Fine adjustment is carried out on the fused image by utilizing the repair network, smooth transition between a pasting area and an original image is realized, and finally, multi-dimensional evaluation is carried out on a repair result through structural consistency score, response consistency score and texture continuity score, so that the generated repair image is ensured to have a sense of reality and classification availability; therefore, high-quality restoration of the image of the polluted area and stability guarantee of subsequent sample identification are realized, and metal recovery management is assisted.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of metal resource recycling, in particular to a metal resource recycling and weighing management system based on the Internet. BACKGROUND

[0002] In the metal sample (tin, indium material) recycling and weighing management, it includes the identification and classification of metal samples, wherein:

[0003] In the sample classification and identification, a deep learning model based on color images or a traditional threshold segmentation is often used, and the RGB image is directly segmented in the front end. It is difficult to take into account both the high light smooth oil stain area and the rust scratch area, and the ability to distinguish high-frequency rough texture and low-frequency overexposure smooth area is insufficient.

[0004] At the same time, a single image repair or mask filling method often ignores the periodic mechanical processing texture and physical priori of the metal surface, and only relies on interpolation or generative adversarial network (GAN), resulting in obvious faults at the sample boundary after repair, which cannot meet the accuracy requirements of subsequent classification and valuation;

[0005] In addition, the system often lacks quantitative evaluation of the repair quality, and there is no effective guarantee for the reliability of the re-classification after image repair, which is easy to cause misclassification or sample valuation error, affecting the recycling efficiency.

[0006] Furthermore, the boundary processing of the traditional scheme is often only a simple cropping and pasting at the pixel level, which cannot perform multi-scale texture analysis from the frequency domain or spatial domain, and lacks special separation measures for the essential difference between high-frequency noise and normal surface texture, making it difficult to fundamentally solve the problems of misclassification and missed classification. After sample classification, the robustness of the classification model to the repaired image cannot be guaranteed, and manual intervention is required when the misclassification rate is high, which increases the operation cost and process instability, and no one scores the continuity and response consistency of the repaired area, thereby greatly improving the overall stability and deployment difficulty of the system, affecting the metal sample recycling management efficiency. SUMMARY

[0007] In view of the above-mentioned shortcomings of the prior art, the present application provides a metal resource recycling and weighing management system based on the Internet, which can effectively solve the problem that the metal sample cannot be accurately identified and classified in the prior art, affecting the subsequent recycling management of the metal.

[0008] To achieve the above purpose, the present application realizes the following technical scheme:

[0009] The present application provides a metal resource recycling and weighing management system based on the Internet, which at least includes:

[0010] An image processing module acquires an original image of the metal sample, identifies a pollution area, outputs a pollution mask image, and determines a pollution connected area;

[0011] A gray-scale image is acquired and wavelet transformed, a texture energy map in each pollution connected area is calculated, an average texture energy is obtained, a texture energy threshold is defined, and it is determined whether to correct the pollution connected area;

[0012] A matching score is calculated according to a pollution template vector and a wavelet coefficient vector of the pollution connected area, it is determined whether to correct the pollution connected area again, and a pollution mask image is obtained again;

[0013] An image cropping area is cropped according to the pollution connected area, and is converted into a texture feature vector, and an image cropping area sample matched with the texture feature vector is found according to the Euclidean distance;

[0014] The image cropping area sample is scaled and pasted into the image cropping area, a pasted image is defined, a boundary fusion equation is performed, a fusion image is solved, and a repaired image is output by splicing the fusion image and the pasted image;

[0015] A processing and analysis module performs structure consistency scoring, response consistency scoring, and texture continuity scoring on the repaired image, and determines whether to output the repaired image;

[0016] An image recognition module outputs the type of the metal sample in response to the input repaired image;

[0017] A cleaning and weighing module outputs the weight of the metal sample in response to the input metal sample;

[0018] An information management module records the type and weight of the metal sample.

[0019] Further, the method for outputting the pollution mask image is:

[0020] Second-order partial derivatives are calculated in the horizontal and vertical directions of the original image respectively, and the results are added to obtain a smoothness image, and a high-light smooth pollution area is identified;

[0021] The original image is converted into a gray-scale image, first-order partial derivatives are calculated in the x direction and the y direction respectively to obtain horizontal and vertical gradients, and then the square root of the sum of the squares of the two gradients is taken to obtain a gradient amplitude image;

[0022] A structure image is established according to the original image, the gradient amplitude image, and the smoothness image;

[0023] The structure image is input into a convolutional neural network, a pollution area is identified, and a pollution probability image of each pixel is output, and the pollution probability image is converted into a pollution mask image.

[0024] Further, the method for identifying the pollution connected area is:

[0025] Remove scattered misjudgments and fill small holes from the contamination mask image, and then perform morphological opening and closing operations in sequence to obtain a smooth and coherent contamination mask image.

[0026] Determine the set of all contaminated pixels in the contaminated mask image, mark the contaminated connected regions in the contaminated mask image, and use the neighborhood connectivity rule and the two-sided scanning algorithm to aggregate scattered pixels into independent contaminated blocks. Adjacent 1 pixels are grouped into several contaminated connected regions.

[0027] Furthermore, one method for correcting contaminated connected regions and obtaining a contaminated mask image is as follows:

[0028] A two-dimensional wavelet transform is performed on the grayscale image to unfold it at multiple scales and in multiple directions, and the texture energy map of each contaminated connected region is extracted.

[0029] In each contaminated connected region, the average texture energy of the texture energy map is calculated, and a texture energy threshold is set accordingly;

[0030] Based on the comparison between the average texture energy and the texture energy threshold, it is determined whether to correct the contaminated connected regions and obtain the contaminated mask map.

[0031] Furthermore, the second method for correcting contaminated connected regions and obtaining a contaminated mask image is as follows:

[0032] A set of wavelet templates for typical contamination patterns is preset, and the matching score between the contamination connected regions and the wavelet templates is calculated.

[0033] Based on the matching score, determine whether to correct contaminated connected regions and obtain a contaminated mask image;

[0034] Typical pollution patterns include:

[0035] Shallow scratches, blurred edges of corrosion spots, hazy deposits, and dust adhesion contamination patterns on metal surfaces.

[0036] Furthermore, the method for finding the image cropping region that matches the texture feature vector is as follows:

[0037] Crop the image cropping region from the original image that is larger than the contaminated connected region;

[0038] Convert the cropped region of the image into a texture feature vector;

[0039] From the metal texture sample library, find an image cropping region sample that matches the current image region, specifically:

[0040] Based on the texture feature vectors in the metal texture sample library and the texture feature vectors transformed from the image cropping region, the matching texture samples are calculated according to the Euclidean distance to obtain the matching image cropping region samples.

[0041] Further, the method for solving the fusion image is:

[0042] Calculate the gradient difference between the fusion image and the new image obtained by scaling the image clipping region sample, and sum the square of the difference value to construct an optimization function for each pixel point in the pollution connected region.

[0043] Ensure that the fusion image is seamlessly connected with the pasted image at the edge of the region, and the forced constraint is:

[0044] The pixel value of the fusion image is equal to the corresponding value of the pasted image.

[0045] Solve by sparse linear system or numerical method, output the fusion image.

[0046] Further, the method for judging whether to output the repair image is:

[0047] Calculate the structure consistency score:

[0048] Extract the edge map of the original image and the repair image;

[0049] Under the action of the pollution mask map, calculate the edge difference of the two edge maps at the corresponding position;

[0050] Sum the edge difference of all pollution region pixels to get the total structure error,

[0051] Get the structure consistency score by normalizing the edge difference;

[0052] Response consistency score:

[0053] Input the original image and the repair image into the image classification model respectively to get two probability vectors;

[0054] Calculate the cosine similarity of the two probability vectors to quantify the response consistency score;

[0055] Texture continuity score:

[0056] Construct the boundary region:

[0057] Determine the edge band in the pollution connected region and the neighborhood band outside the pollution connected region;

[0058] Determine the inner boundary texture area in the repair image and the outer boundary texture area in the original image, and perform gray scale transformation and DCT transformation;

[0059] Use symmetric KL divergence to measure the similarity between the two texture descriptors;

[0060] Map to the texture continuity score;

[0061] The structure consistency score, the response consistency score and the texture continuity score are respectively assigned to corresponding weight coefficients, and a total repair score is obtained by weighted summation.

[0062] Whether to output the repaired image is determined according to the total repair score.

[0063] A computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the system when executing the computer program.

[0064] A computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the system.

[0065] Compared with the known prior art, the technical solution provided by the present application has the following beneficial effects:

[0066] The smoothness map is extracted by calculating the second derivative of the original image, the oil pollution in the highlight area is identified, and the structure pollution edge is extracted based on the gray gradient amplitude map. Then, the structure image is spliced and input into the convolutional neural network to output the pollution mask image, and the pollution connected region is located by combining the morphological processing.

[0067] The metal texture sample library is introduced, the most similar texture image cropping area sample is found by deep feature extraction and sample matching, and image fusion and size adaptation are performed to avoid visual mutation caused by inconsistent boundary textures.

[0068] The fusion image is fine-tuned by the repair network to realize smooth transition between the pasted area and the original image. Finally, the repair result is evaluated in multiple dimensions by structure consistency score, response consistency score and texture continuity score to ensure that the generated repair image has realism and classification availability, thereby realizing high-quality repair of the pollution area image and stability guarantee for subsequent sample identification, and assisting metal recycling management. BRIEF DESCRIPTION OF DRAWINGS

[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0070] Figure 1 The overall module block diagram of the present application. DETAILED DESCRIPTION

[0071] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the protection scope of the present application.

[0072] The present application will be further described below in conjunction with the embodiments.

[0073] Embodiment 1 (see Figure 1 ): An Internet-based metal sample recycling and weighing management system, at least comprising:

[0074] An image processing module is configured to identify a contaminated area of a metal sample to be detected, repair the contaminated area, and establish a repaired image, and the specific steps are as follows:

[0075] An original image of the metal sample is collected, normalized, and the original image is identified for a contaminated area to detect possible corrosion and oil contamination areas in the original image:

[0076] Considering that oil pollution is often manifested as a high-light smooth area with high brightness but weak texture, a convolutional neural network is prone to misidentifying high light as non-pollution (because of low contrast) or high-light background, therefore,

[0077] The second-order partial derivatives of the collected original image are calculated in the horizontal and vertical directions respectively, and the results are added to obtain a smoothness map, which reflects the brightness curvature at each pixel. When an area appears overexposure or smooth reflection, the brightness changes very weakly, and the curvature tends to zero, so the corresponding smoothness map value is also close to 0, which can be used to identify high-light smooth pollution areas such as oil stains, water stains, and coating residues, thereby facilitating the identification of oil stains, water stains, and coating residues.

[0078] Considering that corrosion, scratches, and rust on the surface of the metal sample have obvious texture structure or edge jump, the RGB image itself is not sensitive to texture, and the convolutional neural network may not be able to accurately capture the pollution boundary, therefore:

[0079] An edge of a gray image is extracted to capture the pollution boundary information:

[0080] The original image is converted into a gray image, the first-order partial derivatives are calculated in the x direction and the y direction respectively to obtain horizontal and vertical gradients, and then the square root of the sum of the squares of the two is taken to obtain a gradient amplitude map;

[0081] By enhancing the structure pollution signals such as scratches and corrosion pits, the subsequent convolutional neural network is guided to pay attention to the edges.

[0082] Further, the multi-channel splicing can obtain a structural image input:

[0083]

[0084] wherein, represents a five-channel structural image, represents a gradient amplitude map (1 channel), represents a smoothness map (1 channel) of the original image, represents a color three-channel original image

[0085] The structural image input is input into a convolutional neural network, and a pollution area such as rust, oil stain, etc. existing in the structural image is identified, and a pollution probability map of each pixel is output. Since the structural image is often large and has complex texture features, the pollution probability map can be converted into a pollution mask map by setting a conversion threshold. The pollution mask map is used to mark the pollution connected region existing therein .

[0086] For the identification method of the pollution connected region:

[0087] The obtained pollution mask map is subjected to removal of scattered misjudgment and filling of small holes, and morphological opening operation and closing operation are sequentially performed. The opening and closing operations ensure the integrity of the mask region and avoid subsequent misjudgment of noise micro-holes as effective pollution connected regions, so that a more smooth and continuous pollution mask map is obtained.

[0088] Determine the set of all pollution pixels in the pollution mask map Mark the pollution connected region of the pollution mask map, use the 8-neighborhood (or 4-neighborhood) connectivity rule and two-side scanning algorithm to aggregate the scattered pixels into independent pollution blocks, and group the adjacent 1 pixels into a plurality of pollution connected regions .

[0089] Further, considering that the sample to be detected is a metal sample, the rust area in the pollution connected region thereof usually has a high-frequency rough texture, and the convolutional neural network cannot accurately learn, therefore, a texture detection method is introduced to output a corrected binary mask map, that is:

[0090] By collecting a large number of pollution-free metal sample pollution-free texture data, statistics its frequency spectrum and texture characteristics, this is because the normal texture of metal surface usually has a certain frequency structure, such as regular mechanical processing marks, smooth surface, periodic reflection stripe and so on, and the pollution area (such as rust, oil stain, dust) often has irregular high frequency component, for example, rough, discontinuous, spot type disturbance, etc. By statistics of clean sample frequency spectrum, the normal frequency component distribution range of metal sample can be obtained, and the special wavelet basis can be set (or the parameters of existing wavelet basis are adjusted) based on this, so that the wavelet transform can better separate the normal metal texture (low frequency or specific frequency band) and abnormal pollution texture (high frequency, non-periodic);

[0091] For gray image The two-dimensional wavelet transform is carried out on the (original image conversion), and the texture energy graph in each pollution connected region ( The first Pollution connected region) is calculated:

[0092]

[0093] Wherein, Indicates the texture energy graph, Indicates the scale, Indicates the direction, Indicates the wavelet coefficient after transformation, wherein:

[0094] The greater, the more obvious high frequency texture or mutation exists in the image data at the position, that is, it may be rust, scratch and other pollution;

[0095] The smaller, the smoother the position is, the weaker the texture change is, and the more likely it is a normal metal surface.

[0096] Through the above, it is convenient to distinguish the normal metal texture (mostly regular period / low frequency) and the pollution texture (rough, irregular, high frequency).

[0097] Further, some normal areas, such as metal scratches, screw edges and bright spots, may have complex texture, which is very similar to the pollution area in the feature space, and the convolutional neural network may mistake it as pollution, that is, the pollution mask graph may exist false detection, and the texture characteristics are verified again to retain the part of the real pollution, including:

[0098] According to the texture energy graph, the average texture energy of each pollution area is calculated :

[0099]

[0100] Setting adaptive threshold according to average texture energy:

[0101]

[0102] wherein, denotes the texture energy threshold, denotes the empirical adjustment coefficient, denotes the mean value;

[0103] Thus, if is greater than , the pollution connected region is retained, otherwise it is removed, which can effectively remove the pollution connected region misdetected by the convolutional neural network, and improve the accuracy and robustness of pollution detection.

[0104] Further, to determine whether the pollution region has a texture pattern such as rust or scratch, and to avoid missed detection, there is:

[0105] A set of wavelet templates of typical pollution patterns is preset, usually the wavelet feature map extracted from the pollution image, and the matching score of the pollution connected region and the wavelet template is calculated:

[0106]

[0107] wherein, denotes the matching score, denotes the wavelet coefficient vector of the pollution connected region, denotes the th pollution template vector;

[0108] A matching threshold is set to screen the pollution region:

[0109] If the matching score is greater than the matching threshold, the pollution connected region is retained, otherwise it is removed.

[0110] Thus, through template matching, the recognition ability of typical pollution patterns is enhanced, which may include: shallow scratch, fuzzy edge of corrosion spot, fog-like deposition (non-structural texture), dust adhesion on metal surface, so as to ensure the recognition of false pollution regions, and the false pollution connected regions on the pollution mask map can be removed and the real pollution connected regions can be retained, to obtain the corrected pollution mask map, and the pollution connected regions in the original image data are mapped back according to the corrected pollution mask map.

[0111] Further, for the obtained pollution connected region, a cropped image cropping region is established, and a pre-established metal texture sample library is used to find the most similar image cropping region sample therefrom, and the image cropping region sample is pasted and replaced in the image cropping region in the original image (a colored original image) to obtain a target image region, and a natural transition is realized through fusion and fine-tuning to obtain a repaired image with strong realism, including:

[0112] Considering that the pollution connected region itself has abnormal texture, the direct repair effect is poor, and therefore:

[0113] The minimum / maximum value of all coordinates (bounding boxes) of each pollution connected region is extracted to form a minimum circumscribed rectangle, which is used to locate the local region in the original image that needs to be repaired;

[0114] An image cropping region slightly larger than the pollution connected region is cropped from the original image, and context information is extremely important for texture matching, and the context information is helpful for more accurate matching and natural boundary fusion in the subsequent process;

[0115] The image cropping region is converted into a texture feature vector for matching , represents a feature extractor (such as a VGG16 intermediate layer (such as a network containing 16 layers (with learnable parameters) of convolution + fully connected layers), a deep residual network ResNet, etc.), such as an intermediate convolution feature, represents the image cropping region, and therefore the texture feature of the image cropping region is extracted by using a deep neural network as the basis for similarity measurement with the sample library.

[0116] Then, in order to ensure that the texture prior is used to improve the physical rationality of the recovery, and to make the image repair have a realistic feeling:

[0117] From the pre-constructed metal texture sample library, find the most similar image cropping region sample to the image cropping region in the current pollution connected region, specifically:

[0118] It is known that the metal texture sample library has samples:

[0119] , represents the texture sample (image cropping region sample), represents the texture feature vector of the texture sample;

[0120] The Euclidean distance is calculated to find the most similar sample:

[0121]

[0122] Get matched texture sample, i.e. matched image crop region sample :

[0123]

[0124] Calculate Euclidean distance (L2 distance) to find the nearest sample index , and its corresponding image crop region as the matching result . .

[0125] To avoid image misalignment caused by shape mismatch, scale the matched image crop region sample to the size of the image crop region

[0126]

[0127] where, denotes the resizing function, which resamples the input image to the specified size using bilinear or bicubic interpolation, denotes the direction of the operation, denotes the size vector, denotes the adjusted matching result

[0128] The preliminary recovered region texture may have boundary mutation problems. Copy and paste the scaled to the position of the image crop region in the original image data corresponding to the pollution connected region to obtain the pasted image , denotes the pixel value of the original image, denotes the top-left corner coordinate in the original image data

[0129] To solve the inconsistency of the boundary brightness / texture after pasting, optimize to ensure that the gradient of the pasted region and the original image data boundary transition naturally, perform boundary fusion, and solve the fusion image:

[0130]

[0131] where, denotes the new image obtained by scaling the image crop region, denotes the constraint condition, denotes the fusion image, denotes the gradient of the fusion image, denotes the boundary of the pollution connected region, denotes that on the boundary , the pixel value of the fusion image must be equal to the corresponding value of the pasted image. ​

[0132] By copying the matched image crop region sample to the image crop region in the pollution connected region, the image fusion method described above is used to smooth the transition and eliminate unnatural seams.

[0133] Wherein, when solving the above boundary fusion equation discretely, numerical smoothing is introduced, which causes small textures (such as small scratches on metal surfaces, machining lines) to be weakened, and the details are not clear enough, so:

[0134] By fine-tuning the image pasted and fused by the repair network, compensating for the blur, wire drawing artifacts or local inconsistency after fusion, enhancing the consistency of the repair region with the surrounding, and outputting the final repaired repair image, then:

[0135]

[0136] Wherein, represents the splicing operation, represents using replace, and the whole image obtained after the boundary is smoothly transitioned by the boundary fusion equation, represents the pollution mask image, represents the output repair image, represents the neural network model with parameters , which adopts the U-Net structure.

[0137] Finally, the processing and analysis module can score the repair quality of the repair image to determine whether to use the repair image for subsequent classification input, including:

[0138] Structural consistency score:

[0139] The edge map of the original image and the edge map of the repair image

[0140] Calculate the edge difference of the repair region:

[0141] , represents the edge difference map, represents pixel-by-pixel multiplication;

[0142] Repair region consistency score:

[0143] , represents the structural consistency score, represents a constant.

[0144] Task response consistency score:

[0145] The original image data and the repaired image are respectively input into an image classification model (convolutional neural network), and probability vectors are respectively output , ;

[0146] The consistency of two vectors is calculated according to the cosine similarity:

[0147] , represents the response consistency score.

[0148] Texture boundary continuity score:

[0149] Define morphological operation:

[0150] Dilation operation : A morphological dilation is performed on the pollution mask image using a structure element with a radius of r, to obtain an expanded region;

[0151] Erosion operation : A morphological erosion is performed on the pollution mask image using a structure element with a radius of r (r is used to control the boundary thickness, usually 3-5 pixels), to obtain a contracted region;

[0152] Usually: Perform one erosion operation using an eight-neighborhood cross-shaped structure element with a radius r = 1 {(0, 0), (1, 0), (0, 1), (-1, 0), (0, -1)}; the boundary is filled with a mirror image;

[0153] Perform two dilations on the erosion result to eliminate small area noise introduced by erosion, and all operation boundaries are filled with a mirror image.

[0154] Construct the boundary region:

[0155]

[0156] represents the edge band within the pollution connected region (r represents only those boundary pixels in the original pollution mask image that are removed by the erosion operation), with a thickness of r, represents the neighborhood band outside the pollution connected region (only the newly added edge part after dilation is retained), with a thickness of r;

[0157] The image region used for texture evaluation is:

[0158] , , represents the inner boundary texture region in the repaired image and the outer boundary texture region in the original image, respectively;

[0159] , ​Transformed into gray scale, and then DCT (Discrete Cosine Transform) is performed:

[0160]

[0161] wherein, , respectively represent the internal texture vector (used to measure the repair effect) and the external original texture vector (representing the surrounding environment texture), coefficients are constructed into a one-dimensional spectrum histogram,

[0162] represents the discrete cosine transform, represents the conversion of a color image (RGB) to a gray scale image;

[0163] Then, the symmetric KL divergence is used to evaluate the similarity between the two texture descriptors:

[0164]

[0165] wherein, represents the symmetric KL divergence, which measures the difference between two probability distributions, and the larger the value, the greater the difference, represents the th texture feature bin value, corresponding to the internal repair area; represents the th texture feature bin value, corresponding to the external original image; in this case, , is normalized, which ensures the stability of the symmetric KL divergence calculation.

[0166] Mapping to the texture continuity score :

[0167]

[0168] Further, the structure consistency score , the response consistency score , and the texture continuity score are respectively assigned to the corresponding weight coefficients, and the total repair score is obtained by weighted summation. The total repair score is compared with the score threshold value. If it is not less than the score threshold value, the output repair image is input into the image recognition module, and a pre-set image classification model (such as a convolutional neural network) is used to identify the type of metal sample, and the type of metal sample is recorded synchronously.

[0169] In the above, if it is less than the score threshold value, it is returned, and the repair is re-executed until the total repair score is not less than the score threshold value, effectively avoiding misjudgment or classification errors caused by repair quality differences, and ensuring the accuracy and stability of subsequent identification of metal samples. ​

[0170] The cleaning and weighing module is used to input the identified and classified metal sample into the same type of cleaning area (the same type, because the metal sample type needs to be obtained first, the corresponding cleaning area and cleaning method can be determined to avoid damage to the metal sample without direction), avoid secondary identification and classification caused by mixing with other metal samples, and then input into the drying area for drying and then into the weighing area for weighing, so as to obtain the actual weight of the metal sample.

[0171] The information management module records the type and weight of the metal sample and sends it to the cloud server through the wireless network. The server completes the sample classification, valuation and recycling record archiving for query and processing.

[0172] The metal resource recycling and weighing management method is applied to the metal resource recycling and weighing management system based on the Internet, comprising the following steps:

[0173] The original image of the metal sample is collected, the pollution area is identified, the pollution mask image is output, and the pollution connected area is determined;

[0174] The gray image is obtained and wavelet transform is performed, the texture energy graph in each pollution connected area is calculated, the average texture energy is obtained, the texture energy threshold is defined, and it is judged whether the pollution connected area is corrected;

[0175] The matching score is calculated according to the pollution template vector and the wavelet coefficient vector of the pollution connected area, it is judged whether the pollution connected area is corrected again and the pollution mask image is obtained again;

[0176] An image cropping area is cropped according to the pollution connected area and converted into a texture feature vector, and the image cropping area sample matched with the texture feature vector is found out according to the Euclidean distance;

[0177] The image cropping area sample is scaled and pasted to the image cropping area, the pasted image is defined, the boundary fusion equation is performed, the fusion image is solved and spliced with the pasted image to output the repaired image;

[0178] The repaired image is scored for structural consistency, response consistency and texture continuity, and it is judged whether the repaired image is output;

[0179] In response to the input repaired image, the type of the metal sample is output;

[0180] In response to the input metal sample, the weight is output;

[0181] The type and weight of the metal sample are recorded.

[0182] A computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the system when executing the computer program.

[0183] A computer readable storage medium stores a computer program, and the computer program implements the system when executed by a processor.

[0184] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements will not make the essence of the corresponding technical solutions deviate from the protection scope of the technical solutions of the embodiments of the present application.

Claims

1. An internet-based metal resource recycling weighing management system, characterized in that, include: The image processing module acquires raw images of the metal sample, identifies contaminated areas, outputs a contamination mask map, and determines the contamination connectivity regions. Acquire grayscale images and perform wavelet transform, calculate the texture energy map of each contaminated connected region, obtain the average texture energy, define the texture energy threshold, and determine whether to correct the contaminated connected region; The matching score is calculated based on the contaminated template vector and the wavelet coefficient vector of the contaminated connected region. It is then determined whether the contaminated connected region needs to be corrected twice and the contaminated mask map is obtained again. An image cropping region is constructed based on the contaminated connected components and converted into a texture feature vector. The image cropping region sample that matches the texture feature vector is found based on the Euclidean distance. The image cropping region sample is scaled and pasted into the image cropping region. The pasted image is defined, the boundary fusion equation is performed, the fused image is solved and stitched with the pasted image to output the repaired image. The processing and analysis module performs structural consistency scoring, response consistency scoring, and texture continuity scoring on the repaired image to determine whether to output the repaired image. The image recognition module, in response to the input restored image, outputs the type of the metal sample; Clean the weighing module and output the weight in response to the input metal sample; The information management module records the type and weight of metal samples.

2. The Internet-based metal resource recycling weighing management system according to claim 1, characterized in that, The method for outputting the contamination mask image is as follows: The second-order partial derivatives of the original image are calculated in the horizontal and vertical directions respectively, and the results are added together to obtain a smoothness map, which identifies the areas of specular smoothing contamination. Convert the original image to grayscale, calculate the first-order partial derivatives in the x and y directions respectively to obtain the horizontal and vertical gradients, and then take the square root of the sum of the squares of the two to obtain the gradient magnitude map. A structural image is constructed based on the original image, gradient magnitude map, and smoothness map. The structured image is input into a convolutional neural network to identify contaminated regions and output a contamination probability map for each pixel. The contamination probability map is then converted into a contamination mask map.

3. The Internet-based metal resource recycling weighing management system according to claim 1, characterized in that, The method for identifying the contaminated connected area is as follows: Remove scattered misjudgments and fill small holes from the contamination mask image, and then perform morphological opening and closing operations in sequence to obtain a smooth and coherent contamination mask image. Determine the set of all contaminated pixels in the contaminated mask image, mark the contaminated connected regions in the contaminated mask image, and use the neighborhood connectivity rule and the two-sided scanning algorithm to aggregate scattered pixels into independent contaminated blocks. Adjacent 1 pixels are grouped into several contaminated connected regions.

4. The Internet-based metal resource recycling weighing management system according to claim 1, characterized in that, One method for correcting contaminated connected regions and obtaining a contaminated mask image is as follows: A two-dimensional wavelet transform is performed on the grayscale image to unfold it at multiple scales and in multiple directions, and the texture energy map of each contaminated connected region is extracted. In each contaminated connected region, the average texture energy of the texture energy map is calculated, and a texture energy threshold is set accordingly; Based on the comparison between the average texture energy and the texture energy threshold, it is determined whether to correct the contaminated connected regions and obtain the contaminated mask map.

5. The Internet-based metal resource recycling weighing management system according to claim 1, characterized in that, The second method for correcting contaminated connected regions and obtaining a contaminated mask image is as follows: A set of wavelet templates for typical contamination patterns is preset, and the matching score between the contamination connected regions and the wavelet templates is calculated. Based on the matching score, determine whether to correct contaminated connected regions and obtain a contaminated mask image; Typical pollution patterns include: The pollution patterns include shallow scratches, blurred edges of corrosion spots, hazy deposits, and dust adhesion to metal surfaces.

6. The Internet-based metal resource recycling weighing management system according to claim 1, characterized in that, The method for finding image cropping regions that match texture feature vectors is as follows: Crop the image cropping region from the original image that is larger than the contaminated connected region; Convert the cropped region of the image into a texture feature vector; From the metal texture sample library, find an image cropping region sample that matches the current image region, specifically: Based on the texture feature vectors in the metal texture sample library and the texture feature vectors transformed from the image cropping region, the matching texture samples are calculated according to the Euclidean distance to obtain the matching image cropping region samples.

7. The Internet-based metal resource recycling weighing management system according to claim 1, characterized in that, The method for solving the fused image is as follows: For each pixel in the contaminated connected region, calculate the gradient difference between the fused image and the new image obtained after scaling the sample of the cropped image region, and sum the squared differences to construct an optimization function; Ensure the merged image seamlessly connects to the pasted image at the region edges, enforce constraints: The pixel values ​​of the merged image are equal to the corresponding values ​​of the pasted image; The fused image is output by solving the problem using a sparse linear system or numerical methods.

8. The Internet-based metal resource recycling weighing management system according to claim 1, characterized in that, The method for determining whether to output the repaired image is as follows: Calculate the structural consistency score: Extract edge maps from the original image and the repaired image; Under the influence of the contamination mask image, calculate the edge differences between the two edge images at corresponding positions; The total structural error is obtained by summing the edge differences of all pixels in the contaminated areas. Structural consistency scores are obtained by normalizing edge differences; Response consistency score: The original image and the restored image are input into the image classification model respectively to obtain two probability vectors; Calculate the cosine similarity between two probability vectors to quantify the response consistency score; Texture continuity score: Construct the boundary region: Determine the edge zone within the contaminated connectivity area and the neighboring zone outside the contaminated connectivity area; Identify the inner boundary texture region in the restored image and the outer boundary texture region in the original image, and then perform grayscale transformation and DCT transformation. The similarity between two texture descriptors is measured using symmetric KL divergence. Mapped to a texture continuity score; The structural consistency score, response consistency score, and texture continuity score are assigned corresponding weight coefficients, and the weighted sum is used to obtain the total repair score. The decision to output a repaired image is based on the overall repair score.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the system according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the system according to any one of claims 1 to 8.