Method and system for metal recovery
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-08-11
AI Technical Summary
[0002]近年来,贵金属(例如黄金)作为兼具消费属性与保值功能的金属,其回收市场规模随居民金属持有量增长而持续扩大,行业对回收流程的标准化、高效化及精准化需求日益迫切,传统金属回收模式以人工处理为核心,需依赖操作人员完成金属的称重计量、成色检测、回收价格核算及款项支付等全环节,该模式存在流 配规模化回收场景需求
在本申请的技术方案中,通过验证用户的身份信息,保证了交易主体的合法性与安全性。通过获取金属的重量数据和表面光谱数据并换算初检纯度数据,实现了对金属成色的快速初步评估,使用户能够及时获得价格参考;通过验证复检请求信息和收款信息,确认了用户具备继续交易的意愿与资金接收能力。通过获取断面光谱数据并换算复检纯度数据,能够穿透表面镀层或处理层,获取金属内部的真实成分信息,提升了检测精度,尤其适用于镀金、包金等复杂材质的准确识别;通过基于复检纯度数据生成最终回收价格信息,以内部真实成分为定价依据,避免了表面检测可能带来的估值偏差,保障了交易公平性;通过验证兑换请求信息并基于最终回收价格信息与收款信息执行回收交易,实现了定价与支付环节的无缝衔接,缩短了回收周期。
Smart Images

Figure CN122550123A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of metal recycling technology, specifically to a metal recycling method and system. Background Technology
[0002] In recent years, as a metal that combines consumption attributes and value preservation functions, the recycling market for precious metals (such as gold) has continued to expand along with the increase in residents' metal holdings. The industry's demand for standardization, efficiency and precision in recycling processes is becoming increasingly urgent. The traditional metal recycling model is based on manual processing and relies on operators to complete all aspects of the process, including weighing and measuring the metal, testing its purity, calculating the recycling price and making payments. This model has a demand for large-scale recycling scenarios.
[0003] In related technologies, the purity testing of metal recycling mainly relies on single-spectral analysis or empirical formula estimation. The accuracy of the testing is easily affected by human factors such as the operator's skill level, and the ability to identify complex materials or surface treatment layers such as gold plating and gold filling is limited. In addition, in the existing recycling process, the weighing, testing, pricing, and payment stages are relatively independent, and data relies heavily on manual entry and verification, resulting in a long recycling cycle. Summary of the Invention
[0004] In view of the technical problems existing in the background art, this application provides a metal recycling method and system. The metal recycling method can realize the automation and intelligence of the entire metal recycling process, improve recycling efficiency and detection accuracy, and reduce human interference.
[0005] To achieve the above objectives, in a first aspect, embodiments of this application provide a metal recycling method, comprising: Verify the user's identity information; Obtain the weight data and surface spectral data of the metal, and calculate the initial purity data of the metal based on the surface spectral data; The weight data and initial purity data of the metal are converted into preliminary recycling price information, and the preliminary recycling price information is output. Verify the user's re-inspection request information and payment information; Obtain cross-sectional spectral data of the metal, and calculate the re-inspection purity data of the metal based on the cross-sectional spectral data; The weight data and the re-inspection purity data of the metal are converted into final recycling price information, and the final recycling price information is output. Verify the user's exchange request information, and conduct the metal recycling transaction based on the final recycling price information and the payment information.
[0006] Furthermore, the step of acquiring the cross-sectional spectral data of the metal and calculating the re-inspection purity data of the metal based on the cross-sectional spectral data includes: Acquire images of metal cross sections; The metal cross-section image is divided into multiple sub-regions, and the feature information of each sub-region is extracted. The feature information is input into a preset metal content prediction model to obtain the predicted metal content value for each sub-region; The predicted metal content values are weighted and fused to obtain the metal content detection results.
[0007] Furthermore, the step of segmenting the metal cross-section image into multiple sub-regions and extracting feature information from each sub-region includes: The metal cross-section image is divided into multiple sub-regions, and the spectral intensity data and cross-section thickness data of each sub-region are obtained. Feature information is extracted from the spectral intensity data and the cross-section thickness data.
[0008] Furthermore, acquiring the metal cross-section image includes: Obtain the raw image containing the metal; The original image is preprocessed to obtain a preprocessed image; Edge detection is performed on the preprocessed image to obtain the edge detection results; The edge detection results are subjected to subpixel-level nonmaximum suppression processing; Connect the suppressed edges to form continuous edge segments; The target outline of the metal is selected from the continuous edge segments, and its location is determined; Based on the target contour, select a test point within the area it defines; Based on the test points, obtain the cross-sectional image of the metal.
[0009] Furthermore, the step of preprocessing the original image to obtain a preprocessed image includes: The original image is converted to the target color space and the color component image is extracted. The color component image is subjected to illumination normalization processing; Adaptive binarization is performed on the image after illumination normalization. Noise reduction is performed on the binarized image.
[0010] Furthermore, the acquisition of metal weight data and surface spectral data, and the calculation of initial purity data of the metal based on the surface spectral data, includes: Control the opening of the recovery capsule; Verify the user's metal insertion information and control the closing of the recycling bin; The weight detection module is controlled to collect the weight data of the metal, and the spectral detection module is controlled to collect the surface spectral data of the metal; The initial purity data of the metal is calculated based on the surface spectral data.
[0011] Furthermore, the step of acquiring the cross-sectional spectral data of the metal and calculating the re-inspection purity data of the metal based on the cross-sectional spectral data includes: Control the cutting mechanism to cut the metal and obtain the cross-section of the metal; The control spectral detection module acquires the cross-sectional spectral data of the metal section; The purity data of the metal was calculated based on the cross-sectional spectral data.
[0012] Furthermore, after verifying the user's exchange request information and conducting the metal recycling transaction based on the final recycling price information and the payment information, the process includes: The control transfer mechanism transfers the metal in the recovery compartment to a safe, thereby emptying the recovery compartment.
[0013] This application also proposes a metal recycling system, including: The identity verification module is used to verify the user's identity information; The initial inspection data acquisition module is used to acquire the weight data and surface spectral data of the metal, and to calculate the initial inspection purity data of the metal based on the surface spectral data. The initial inspection and pricing module is used to calculate the initial recycling price information based on the weight data and the initial inspection purity data of the metal, and output the initial recycling price information. The re-inspection request verification module is used to verify the user's re-inspection request information and payment information; The re-inspection data acquisition module is used to acquire cross-sectional spectral data of the metal and calculate the re-inspection purity data of the metal based on the cross-sectional spectral data. The re-inspection pricing module is used to calculate the final recycling price information based on the weight data of the metal and the re-inspection purity data, and output the final recycling price information. The transaction execution module is used to verify the user's exchange request information and to conduct metal recycling transactions based on the final recycling price information and the payment information.
[0014] Furthermore, it also includes: The recovery compartment is used to hold metal and can be opened or closed. A weight detection module is installed inside the recycling chamber to collect the weight data of the metal; A spectral detection module, located inside the recovery chamber, is used to collect surface spectral data and cross-sectional spectral data of the metal.
[0015] A cutting mechanism used to cut metal to obtain a cross-section; Safes are used to securely store recycled metals; A transfer mechanism for transferring metal from the recycling bin to the safe.
[0016] The beneficial effects of this application are as follows: In the technical solution of this application, the legitimacy and security of the transaction entity are ensured by verifying the user's identity information. By acquiring the weight data and surface spectral data of the metal and converting them into initial purity data, a rapid preliminary assessment of the metal's purity is achieved, enabling users to obtain price references in a timely manner. By verifying the re-inspection request information and payment information, the user's willingness to continue the transaction and their ability to receive funds are confirmed. By acquiring cross-sectional spectral data and converting it into re-inspection purity data, the true composition information of the metal's interior can be obtained through surface coatings or treatment layers, improving detection accuracy, especially suitable for the accurate identification of complex materials such as gold plating and gold filling. By generating final recycling price information based on the re-inspection purity data, and using the true internal composition as the pricing basis, the valuation deviation that may be caused by surface testing is avoided, ensuring the fairness of the transaction. By verifying the exchange request information and executing the recycling transaction based on the final recycling price information and payment information, the pricing and payment processes are seamlessly connected, shortening the recycling cycle.
[0017] Furthermore, it is worth mentioning that the preliminary inspection is a non-destructive analysis of the metal surface. Based on the user's re-inspection request information, the metal is dissected and the internal cross-section is analyzed to further improve the detection accuracy. The two analyses eliminate the interference of surface coatings or treatment layers on the detection results, effectively solving the identification problem of complex materials such as gold plating and gold filling.
[0018] In summary, the technical solution of this application organically integrates identity verification, data collection, purity testing, price calculation, and transaction execution, forming a closed-loop automated recycling process. This significantly reduces manual intervention and lowers the errors and risks caused by human factors. At the same time, through the dual mechanism of surface inspection and cross-section re-inspection, it balances detection efficiency and accuracy, meeting the needs of large-scale recycling scenarios for standardization, efficiency, and precision.
[0019] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of this application, the accompanying drawings used in this application will be briefly described below. Obviously, the drawings described below are merely some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without any creative effort.
[0021] Figure 1 This is a schematic diagram of the process of a gold recycling method provided in the embodiments of this application. Detailed Implementation
[0022] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0024] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0025] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0026] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0027] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).
[0028] In the description of the embodiments of this application, the technical terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the embodiments of this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.
[0029] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0030] In recent years, as a metal that combines consumption attributes and value preservation functions, the recycling market for precious metals (such as gold) has continued to expand along with the increase in residents' metal holdings. The industry's demand for standardization, efficiency and precision in recycling processes is becoming increasingly urgent. The traditional metal recycling model is based on manual processing and relies on operators to complete all aspects of the process, including weighing and measuring the metal, testing its purity, calculating the recycling price and making payments. This model has a demand for large-scale recycling scenarios.
[0031] In related technologies, the purity testing of metal recycling mainly relies on single-spectral analysis or empirical formula estimation. The accuracy of the testing is easily affected by human factors such as the operator's skill level, and the ability to identify complex materials or surface treatment layers such as gold plating and gold filling is limited. In addition, in the existing recycling process, the weighing, testing, pricing, and payment stages are relatively independent, and data relies heavily on manual entry and verification, resulting in a long recycling cycle.
[0032] like Figure 1 As shown, in order to solve the above-mentioned technical problems, in a first aspect, embodiments of this application provide a metal recycling method, including: Verify the user's identity information; Obtain the weight data and surface spectral data of the metal, and calculate the initial purity data of the metal based on the surface spectral data; The weight data and initial purity data of the metal are converted into preliminary recycling price information, and the preliminary recycling price information is output. Verify the user's re-inspection request information and payment information; Obtain cross-sectional spectral data of the metal, and calculate the re-inspection purity data of the metal based on the cross-sectional spectral data; The weight data and the re-inspection purity data of the metal are converted into final recycling price information, and the final recycling price information is output. Verify the user's exchange request information, and conduct the metal recycling transaction based on the final recycling price information and the payment information.
[0033] In the technical solution of this application, the legitimacy and security of the transaction entity are ensured by verifying the user's identity information. By acquiring the weight data and surface spectral data of the metal and converting them into initial purity data, a rapid preliminary assessment of the metal's purity is achieved, enabling users to obtain price references in a timely manner. By verifying the re-inspection request information and payment information, the user's willingness to continue the transaction and their ability to receive funds are confirmed. By acquiring cross-sectional spectral data and converting it into re-inspection purity data, the true composition information of the metal's interior can be obtained through surface coatings or treatment layers, improving detection accuracy, especially suitable for the accurate identification of complex materials such as gold plating and gold filling. By generating final recycling price information based on the re-inspection purity data, and using the true internal composition as the pricing basis, the valuation deviation that may be caused by surface testing is avoided, ensuring the fairness of the transaction. By verifying the exchange request information and executing the recycling transaction based on the final recycling price information and payment information, the pricing and payment processes are seamlessly connected, shortening the recycling cycle.
[0034] Furthermore, it is worth mentioning that the preliminary inspection is a non-destructive analysis of the metal surface. Based on the user's re-inspection request information, the metal is dissected and the internal cross-section is analyzed to further improve the detection accuracy. The two analyses eliminate the interference of surface coatings or treatment layers on the detection results, effectively solving the identification problem of complex materials such as gold plating and gold filling.
[0035] In summary, the technical solution of this application organically integrates identity verification, data collection, purity testing, price calculation, and transaction execution, forming a closed-loop automated recycling process. This significantly reduces manual intervention and lowers the errors and risks caused by human factors. At the same time, through the dual mechanism of surface inspection and cross-section re-inspection, it balances detection efficiency and accuracy, meeting the needs of large-scale recycling scenarios for standardization, efficiency, and precision.
[0036] It is understood that, in some embodiments, verifying the user's identity information includes: obtaining a mobile phone number entered by the user; sending a verification code to the mobile phone number; obtaining the verification code entered by the user, and verifying the validity of the verification code.
[0037] In this embodiment, the user's identity is quickly verified through the SMS verification code mechanism, eliminating the need for the user to carry physical identification documents, thus lowering the operational threshold for identity verification. At the same time, SMS verification has high security and widespread adoption, and can confirm that the user is the legitimate holder of the mobile phone number, providing a reliable contact method for subsequent transaction tracing.
[0038] It is understood that, in some embodiments, the metal recycling method further includes: verifying the user's cancellation request information, terminating the metal recycling process, controlling the opening of the recycling bin, and returning the metal.
[0039] In this embodiment, a cancellation request verification mechanism is set up to enable users to voluntarily exit at each stage of the transaction. When a user is dissatisfied with the initial inspection price or the re-inspection price, or decides to terminate the transaction for other reasons, they can actively interrupt the recycling process by entering cancellation request information. The system will then automatically control the recycling bin to open and return the metal.
[0040] It is understood that, in some embodiments, verifying the user's payment information and re-inspection request information includes: verifying the user's entered name, ID number, and bank account; and verifying the user's re-inspection request information.
[0041] In this embodiment, by verifying the consistency between the user's entered name, ID number, and bank account, it is ensured that the receiving account belongs to the user whose identity has been verified, thus preventing the risk of fraudulent withdrawal during the fund transfer process. The verification of the bank account information provides an accurate payment path for the subsequent automatic transfer of funds, while the verification of the re-inspection request information confirms the user's clear intention to accept destructive testing and continue the transaction.
[0042] It is understood that, in some embodiments, verifying the user's payment information and re-inspection request information includes: verifying the user's payment information; verifying the user's re-inspection agreement signing information and re-inspection operation confirmation information.
[0043] In this embodiment, the verification of the re-inspection agreement signing information clearly records the user's legal intention to agree to destructive cutting and testing of metal in the form of an electronic agreement, fixing the rights and obligations of both parties in a digital way and reducing the risk of transaction disputes; the verification of the re-inspection operation confirmation information is achieved through a secondary confirmation mechanism to ensure that the user, knowing that the cutting operation is irreversible, still actively expresses the final intention to continue the transaction.
[0044] In some embodiments, acquiring cross-sectional spectral data of the metal and calculating the re-inspection purity data of the metal based on the cross-sectional spectral data includes: Acquire images of metal cross sections; The metal cross-section image is divided into multiple sub-regions, and the feature information of each sub-region is extracted. The feature information is input into a preset metal content prediction model to obtain the predicted metal content value for each sub-region; The predicted metal content values are weighted and fused to obtain the metal content detection results.
[0045] In this embodiment, by segmenting the metal cross-section image into multiple sub-regions, a refined analysis of potential compositional inhomogeneities within the sample cross-section can be performed, reducing the limitations of treating the sample as an ideal entity with uniform composition in existing technologies. By extracting feature information from each sub-region, the model can accurately capture the metal distribution characteristics of each region. The feature information from each sub-region is then input into a preset metal content prediction model to obtain corresponding predicted values, which are then weighted and fused. The final metal content detection result reflects the overall metal content of the sample, effectively reducing detection bias caused by cross-sectional inhomogeneity and improving the accuracy and reliability of the detection results.
[0046] In some embodiments, the metal cross-section image is segmented into multiple sub-regions, and feature information of each sub-region is extracted, including: The metal cross-section image is divided into multiple sub-regions, and the spectral intensity data and cross-section thickness data of each sub-region are obtained. Feature information is then extracted from the spectral intensity data and cross-section thickness data.
[0047] In this embodiment, by acquiring the spectral intensity data and cross-sectional thickness data of each sub-region, key features of the sub-region can be captured from both the physical properties and optical characteristics of the sample. Information reflecting the radiation characteristics of metallic elements, such as average spectral intensity and signal-to-noise ratio, can be extracted from the spectral intensity data, while parameters reflecting the geometric shape of the sub-region and its weight in the overall cross-section, such as average thickness and area ratio, can be obtained from the cross-sectional thickness data.
[0048] In some embodiments, the feature information includes area percentage, average thickness, average spectral intensity, and signal-to-noise ratio.
[0049] In this embodiment, the area ratio reflects the spatial proportion of the sub-region in the entire metal cross-section, determining the weight in the final detection result; the average thickness reflects the physical thickness characteristics of the sub-region, and different thicknesses may have different effects on the absorption and scattering of spectral signals, thus relating to the distribution of metal content; the average spectral intensity is a direct optical indicator reflecting the metal element content, and higher intensity usually corresponds to a higher metal content; the signal-to-noise ratio reflects the quality of spectral data, and a high signal-to-noise ratio can reduce the interference of noise on subsequent model predictions.
[0050] Understandably, spectral intensities can be of various types, such as fluorescence intensity and X-ray fluorescence intensity, and the specific type can be selected based on the actual detection scenario and the type of metal. For example, in gold content detection, the content is often analyzed by detecting the characteristic X-ray fluorescence intensity produced by gold elements under specific excitation conditions; in this case, the spectral intensity data is the X-ray fluorescence intensity information. In the detection of other metals such as copper and iron, the characteristic fluorescence spectra of the corresponding elements can also be used for analysis to ensure the specificity and accuracy of feature information extraction.
[0051] In some embodiments, the spectral intensity data includes fluorescence intensity information.
[0052] In this embodiment, fluorescence intensity information can directly reflect the radiation characteristics of metal elements under specific excitation conditions. Different metal elements have unique fluorescence emission spectra, and their intensity is strongly correlated with the content of the metal element. By collecting fluorescence intensity information of sub-regions, the characteristic signals of target metal elements can be captured in a targeted manner, providing key optical feature inputs for subsequent metal content prediction models, which helps to improve the sensitivity and specificity of the model in predicting metal content.
[0053] In some embodiments, the metal cross-section image is segmented into multiple sub-regions, and feature information of each sub-region is extracted, including: The metal cross-section image is divided into multiple sub-regions, the initial data of each sub-region is extracted, and the initial data is preprocessed to obtain feature information.
[0054] In this embodiment, preprocessing the initial data removes noise, interference, and outliers, improving the quality and reliability of the feature information. For example, when acquiring spectral intensity data, factors such as ambient light and instrument noise may affect the initial data, resulting in irrelevant signals. Similarly, cross-sectional thickness data may contain errors due to instrument inaccuracies or uneven sample surfaces. Preprocessing cleanses and optimizes this initial data, allowing the extracted feature information to more accurately reflect the inherent properties of the sub-region. This provides more accurate input for subsequent metal content prediction models, further enhancing the stability and accuracy of the entire detection method.
[0055] Understandably, the specific preprocessing method can be selected based on the type and characteristics of the initial data. For example, for spectral intensity data, smoothing filtering and background subtraction can be used; for cross-sectional thickness data, outlier removal and data normalization can be performed.
[0056] In some embodiments, the metal cross-section image is segmented into multiple sub-regions, initial data of each sub-region is extracted, and the initial data is preprocessed to obtain feature information, including: The metal cross-section image is divided into multiple sub-regions, and the initial data of each sub-region is extracted. The initial data is filtered to obtain the filtered data; The filtered data is then constrained to obtain feature information.
[0057] In this embodiment, filtering removes high-frequency noise and random interference from the initial data. For example, it removes glitch signals from spectral intensity data caused by fluctuations in instrument electronic components, or anomalous jumps in cross-sectional thickness data caused by minute protrusions on the sample surface. This makes the data curve smoother and highlights its inherent trend. Constraint processing, based on the physical properties of the metal sample and the actual needs of the detection scenario, sets reasonable value ranges or logical rules for the filtered data. For example, it sets upper and lower thresholds for the thickness range of different metal materials to eliminate abnormal data points exceeding reasonable ranges; or it normalizes the spectral intensity data, constraining it within a specific numerical range. This ensures that the feature information of different sub-regions has uniform dimensions and comparability, reducing the adverse effects of data magnitude differences on subsequent model predictions, thereby further improving the stability and effectiveness of the feature information.
[0058] Specifically, in one embodiment, an X-ray fluorescence detection module is used to perform surface scanning of the sample cross-section with a spatial resolution of 0.5 mm × 0.5 mm to obtain the characteristic fluorescence intensity of the target element at each scanning point (x, y) and form an original intensity matrix I_raw(x, y) ∈ R^(M × N) (M and N are the number of rows and columns of the scanning points). The thickness values of each scanning point (x,y) are synchronously acquired using a laser ranging module to form the original thickness matrix h_raw(x,y)∈R^(M×N); Based on gradient analysis of I_raw(x,y) (calculating the intensity change rate ∇I between adjacent points), preliminary identification of component segregation regions is performed (defined as: continuous regions where ∇I > 5% are potential segregation regions).
[0059] For I_raw(x,y): use 3×3 median filtering to remove abnormally high intensity points caused by surface stains and scratches (removal threshold: intensity > 3 times local standard deviation) to obtain the smoothed intensity matrix I(x,y); For h_raw(x,y): Gaussian filtering (σ=1.0) is used to eliminate laser scanning noise, resulting in a smoothed thickness matrix h(x,y); Output preprocessing results: I(x,y), h(x,y) and preliminary labeling of the segregation region.
[0060] An initial seed point (x0, y0) is selected in the central region of the metal cross-section, requiring that the strength and thickness of this point are both within ±1% of the global mean. Starting from the seed point, expand outwards to the surrounding neighboring points (8-neighborhood), with the following expansion conditions: Thickness constraint: The deviation between the thickness h(x,y) of the neighboring point and the average thickness of the current sub-region is ≤3% (i.e., |h(x,y)-havg|≤0.03h_avg); Intensity constraint: The deviation between the fluorescence intensity I_j(x,y) of each element at a neighboring point and the average intensity of the current sub-region is ≤4% (i.e., |I_j(x,y)-I_j_avg|≤0.04I_j_avg, where j is the element type). Segregation constraint: If a neighboring point is located in a marked segregation region, it is only allowed to merge with regions that have the same segregation characteristics (e.g., Au segregation regions are only merged with Au segregation regions).
[0061] When the expansion fails to meet the above rules, the growth of the current sub-region is terminated and marked as S_k (k=1,2,...,N); the steps of selecting a seed point and expanding outwards from the seed point to surrounding neighboring points (8-neighborhood) are repeated until the entire metal cross-section is covered, ultimately resulting in N sub-regions. The key parameters of each sub-region are recorded: Area percentage ω_k = Area(S_k) / TotalArea (TotalArea is the total cross-sectional area); Average thickness h_k = mean(h(x,y)∈S_k); Average fluorescence intensity I_j^k=mean(I_j(x,y)∈S_k) (j is the element type); Signal-to-noise ratio (SNR) = mean(I_j^k) / std(I_j(x,y)∈S_k) (reflects the signal stability in this region).
[0062] This setup, utilizing high-resolution (0.5mm × 0.5mm) surface scanning by the X-ray fluorescence detection module combined with simultaneous laser thickness measurement, improves data accuracy. High-resolution scanning ensures the capture of details of compositional segregation and thickness variations at the microscopic scale, facilitating subsequent operations. Gradient analysis allows for the initial identification of segregated regions, quickly and preliminarily pinpointing areas where abnormal compositional fluctuations may exist. Merging sub-regions with excessively large compositional differences reduces the likelihood of merging sub-regions, resulting in internally homogeneous compositional distributions in the final segmented regions. Median filtering and Gaussian filtering address different types of noise in elemental intensity and thickness data, respectively. Median filtering effectively removes isolated, sharp signal anomalies caused by surface micro-defects (stains, scratches) without disrupting the boundaries of the true segregated regions. Gaussian filtering smooths random noise in laser ranging, yielding a more realistic thickness distribution trend. Together, they improve the signal-to-noise ratio. Thickness constraints ensure uniform thickness within each segmented sub-region (deviation ≤3%). Intensity constraints ensure uniform distribution of target elements within each sub-region (deviation ≤4%). Combined with thickness constraints, this ensures that the final defined sub-regions are material micro-units that simultaneously satisfy both physical structure and chemical composition homogeneity. Segregation constraints ensure that regions with different segregation characteristics do not merge during region growth, thus maintaining the clarity of segregated region boundaries and the uniqueness of their composition. Working in synergy with thickness and strength constraints, segregation constraints further refine the sub-region division criteria, ensuring that each generated sub-region is not only homogeneous in thickness and main composition but also possesses consistent segregation characteristics—that is, the same sub-region contains only the same type of segregated or non-segregated regions, avoiding fragmentation caused by drastic fluctuations in local composition. By selecting seed points near the global mean, growth is ensured to begin from typical matrix regions, making the segmentation process more stable.
[0063] In some embodiments, feature information is input into a preset metal content prediction model to obtain the predicted metal content value for each sub-region, including: Input the feature information into the spectral correction model to obtain the spectral correction feature information; The spectrally corrected feature information is input into a preset metal content prediction model to obtain the predicted metal content value for each sub-region.
[0064] In this embodiment, the spectral data in the feature information are systematically calibrated and optimized by using a spectral correction model, which can effectively eliminate or reduce the interference of various factors on the spectral signal.
[0065] It is worth mentioning here that in the traditional FP method, the theoretical formula for calculating the characteristic fluorescence intensity of element j is based on the assumption of global uniformity and does not consider local thickness and matrix differences. The formula is as follows: (Where: K is the instrument constant,) For the content of element j, It is the photoelectric absorption cross section. ρ is the fluorescence yield, μ is the mass absorption coefficient, and ρ is the sample density. (This is the global average thickness).
[0066] Traditional FP methods do not specifically correct for the secondary excitation of low atomic number elements (such as Ag and Cu) by high atomic number elements (such as Au) in gold samples (i.e., after high Z elements are excited by primary X-rays, their characteristic X-rays will excite low Z elements a second time, resulting in enhanced fluorescence intensity of low Z elements).
[0067] Specifically, in one embodiment, the present invention introduces a local thickness for the sub-region S_k. The formula for correcting the absorption effect, based on local matrix parameters, is as follows: in: (m represents all elements within the sub-region, (The mass absorption coefficient of element m for primary X-rays can be obtained by looking up a table). (m represents all elements within the sub-region, (The mass absorption coefficient of element m for primary X-rays can be obtained by looking up a table). ( (where m is the density of a pure element). Let S be the content of element j within the subregion S_k.
[0068] The spectral correction model is shown below: in: Let m be the atomic number of element m. Let be the excitation cross section of element j by the characteristic X-rays of element m. The mass absorption coefficient of element j to the characteristic X-rays of element m. (This refers to the average depth of action of the secondary excitation).
[0069] After correction, the theoretical fluorescence intensity of element j within subregion S_k is: This setup, by incorporating the local thickness and matrix parameters of the sub-region into the absorption effect formula and combining it with a spectral correction model to quantify and compensate for the secondary excitation effect, allows the calculation of theoretical fluorescence intensity to more accurately reflect the actual physicochemical state of the sub-region. Compared to the coarse calculations based on the global uniformity assumption of the traditional FP method, the correction model of this invention can effectively capture the fluorescence intensity deviations caused by local characteristics such as thickness differences, matrix composition variations, and secondary excitation of low-Z elements by high-Z elements in different sub-regions of gold samples. This provides a more reliable input basis for subsequent metal content prediction models, significantly improving the accuracy and stability of metal content predictions, and is particularly suitable for the refined analysis of gold samples with complex compositions and heterogeneous structures.
[0070] In some embodiments, each predicted metal content value is weighted and fused to obtain the metal content detection result, including: The metal content prediction value is solved iteratively to obtain the metal content detection result.
[0071] In this embodiment, by using an iterative solution method, multiple rounds of optimization calculations can be performed based on the predicted metal content of each sub-region and its corresponding weight, gradually approaching the true value of the overall metal content of the sample.
[0072] Specifically, in one embodiment, based on the measured intensity of the sub-region With theoretical strength The error is solved using Newton's iteration method. : Wherein, the initial value of the iteration Global computation results using the traditional FP method; partial derivatives Using the theoretical fluorescence intensity formula The derivative yields the rate of influence of content changes on theoretical strength.
[0073] Iteration termination condition: (i.e., content deviation ≤ 0.01%), at this time, output the gold content of sub-region S_k. .
[0074] Weighted fusion calculation: in: This represents the area percentage of the sub-region recorded in S2.3 (reflecting the physical proportion of the region).
[0075] As a reliability factor, the more reliable the data in this region, the greater its weight.
[0076] This setup, through a dual weighting of area proportion and reliability factor, ensures that the metal content detection results depend on the actual physical proportion of each sub-region in the sample and the contribution of sub-regions with high data reliability to the final result. For example, if the measured intensity of a sub-region has a small error compared to the theoretical intensity, it indicates high data reliability for that region, resulting in a larger reliability factor. During weighted fusion, the predicted metal content value for that sub-region will be assigned a higher weight, thus making the final metal content detection result closer to the true state of the sample. This weighted fusion method, combining area proportion and reliability factor, effectively reduces the result bias that may be caused by weighting with a single factor, improving the accuracy of metal content detection.
[0077] In some embodiments, each predicted metal content value is weighted and fused to obtain the metal content detection result, including: Each predicted metal content value is weighted and fused to obtain preliminary metal content detection results; The preliminary metal content test results are checked for deviations to obtain the final metal content test results.
[0078] In this embodiment, deviation verification enables secondary verification and correction of the metal content detection results obtained from the initial fusion, further improving the accuracy and reliability of the results. Specifically, deviation verification can be combined with preset verification rules or historical detection data to determine whether the preliminary results are within a reasonable error range. For example, if the deviation between the preliminary results and the known content of a similar standard sample exceeds a set threshold, a deviation correction mechanism is triggered. This mechanism can dynamically optimize the preliminary results by readjusting the weight allocation of each sub-region, re-evaluating the predicted values of abnormal sub-regions, or introducing additional constraints. Ultimately, a more reliable metal content detection result after deviation verification is output, effectively avoiding the impact of prediction deviations in individual sub-regions or unreasonable weight allocation on the overall results.
[0079] Specifically, in one embodiment, the global theoretical total strength is calculated. Compared with the measured total strength Relative deviation: .
[0080] like ,but This is a valid result; like Return to weighted fusion and iterate again (adjust initial values). (95% of the result of the previous calculation), until .
[0081] This setup uses the relative deviation between the theoretical and measured total intensity as a verification index, forming a dynamic feedback iterative optimization mechanism. When the relative deviation δ is within the set threshold ε, it indicates that the preliminary metal content detection result is highly consistent with the actual situation and can be directly used as the final metal content detection result. However, when δ exceeds ε, it indicates that the preliminary result may have some systematic deviation or local prediction anomalies. In this case, by adjusting the initial value α to 95% of the previous calculation result and re-performing the weighted fusion calculation, it is equivalent to making targeted fine-tuning of the weight allocation, gradually narrowing the gap between theory and measurement. This iterative process can continuously correct deviations caused by improper initial weight settings or interference from local regional features, making the final output metal content detection result highly reliable in both theoretical derivation and actual measurement dimensions, thereby significantly improving the robustness of the entire detection method.
[0082] In some embodiments, acquiring the metal cross-section image includes: Obtain the raw image containing the metal; The original image is preprocessed to obtain a preprocessed image; Edge detection is performed on the preprocessed image to obtain the edge detection results; The edge detection results are subjected to subpixel-level nonmaximum suppression processing; Connect the suppressed edges to form continuous edge segments; The target outline of the metal is selected from the continuous edge segments, and its location is determined; Based on the target contour, select a test point within the area it defines; Based on the test points, obtain the cross-sectional image of the metal.
[0083] Preprocessing the original image effectively reduces noise from complex lighting and background interference, laying a solid foundation for subsequent edge detection. Edge detection is then performed on this basis, combined with sub-pixel-level non-maximum suppression, enabling precise edge point localization and significantly improving edge positioning accuracy. The suppressed edges are then connected to form continuous edge segments. This step overcomes the edge breakage problem that may be caused by irregular metal cross-sections, resulting in more complete and coherent edge information. Next, the target metal contour is selected from the continuous edge segments, and its position is determined, ensuring the accuracy and stability of contour extraction and avoiding interference from non-target contours. Finally, test points are selected within the defined area based on the target contour, providing precise positional references for subsequent non-destructive purity analysis and other detection steps. This effectively improves the accuracy and reliability of the overall detection process of the intelligent gold recycling terminal and promotes the standardization of intelligent upgrading in the metal recycling industry.
[0084] Understandably, the raw image refers to the unprocessed visual data containing metal, directly acquired by an image acquisition module (such as a high-definition industrial camera). It may contain complex background information, uneven lighting, and detailed features of the metal itself, such as texture, reflection, and cut surfaces. This raw image serves as the fundamental input for all subsequent image processing and analysis steps, and its quality (such as resolution, sharpness, and lighting conditions) directly affects the preprocessing and subsequent processing results.
[0085] Understandably, preprocessing refers to a series of targeted image enhancement and noise suppression operations performed on the original image, aiming to eliminate or reduce the interference of complex environmental factors (such as changes in lighting, cluttered background textures, sensor noise, etc.) on metal contour extraction, highlight the effective features of the metal target area, and provide high-quality image data for subsequent edge detection.
[0086] Understandably, preprocessing can be achieved in various ways, such as spatial geometric transformations (e.g., scaling, cropping, rotation) to unify dimensions or increase data diversity; color and contrast adjustments (e.g., grayscale, normalization, histogram equalization) to standardize input or enhance features; image enhancement techniques (e.g., adding noise, random color dithering, advanced blending methods) to improve model generalization by simulating real-world variations; and filtering and denoising (e.g., Gaussian filtering, median filtering) to eliminate noise interference. In practical applications, these methods are typically combined into a workflow depending on the specific task.
[0087] In some embodiments, the step of preprocessing the original image to obtain a preprocessed image includes: The original image is converted to the target color space and the color component images are extracted. Illumination normalization is performed on the color component image; Adaptive binarization is performed on the image after illumination normalization. Noise reduction is performed on the binarized image.
[0088] In this embodiment, by converting the original image to the target color space and extracting the color component images, the differences between the metal and the background in specific color dimensions can be highlighted, providing more discriminative image data for subsequent processing. Illumination normalization effectively eliminates local brightness differences in the image caused by uneven illumination, making the overall grayscale distribution of the image more balanced and avoiding interference from excessively bright or dark areas on feature extraction. Adaptive binarization, by dynamically calculating the threshold of each pixel, can more accurately separate the foreground and background areas of the metal under complex background and lighting conditions. Compared with fixed threshold binarization, it is more adaptable to local grayscale changes in the image. Denoising further removes isolated noise points and small interference contours that may be introduced during binarization, allowing subsequent edge detection to focus on the real edge information of the metal, thereby improving the overall quality of the preprocessed image and providing a foundation for accurate extraction of metal contours.
[0089] It is understandable that color component extraction from images can be achieved in various ways. For example, standard color components can be directly obtained by calling OpenCV library functions for color space conversion and channel separation; color components can be generated or verified by performing mathematical operations on pixels according to conversion formulas; and deep learning models can learn from images and output task-related abstract feature representations, which are often presented in the form of single-channel feature maps. The specific implementation method needs to be selected based on the actual task requirements, environmental conditions, and resource constraints.
[0090] In some embodiments, the steps of converting the original image to a target color space and extracting the color component image include: Convert the original image to the HSV color space; Extract the H component image from the HSV color space.
[0091] In this embodiment, by converting the original image to the HSV color space, the image's brightness (V component) and color information (H and S components) can be separated, effectively reducing the impact of illumination changes on color perception. Since the H component (hue) of metal in the HSV color space has a relatively stable range, extracting the H component image can highlight the hue difference between the metal and the background. For example, metal typically exhibits a specific golden hue, while the background may contain other colors or complex textures. The H component image can more clearly distinguish the metal area from the background area, providing more targeted input data for subsequent illumination normalization and binarization processing, thereby improving the accuracy and robustness of preprocessing.
[0092] It's important to note that the golden hue of metal exhibits a stable range in the H component, typically between 20° and 60°. This range effectively separates the metal from the background, covering the hue of most common metals (such as pure gold and 24K gold). By setting upper and lower thresholds for the H component (e.g., a lower limit of 20° and an upper limit of 60°), pixel regions in the image that match the characteristics of a metallic hue can be initially filtered out. Background pixels that clearly do not belong to a metallic hue (such as low H-value regions in dark backgrounds, or interfering regions with other hues like red or blue) can be initially excluded. This allows for the initial localization of the metallic target in the color dimension, narrowing the scope of focus for subsequent processing steps such as illumination normalization and reducing interference from irrelevant background information.
[0093] Specifically, in one embodiment, the acquired RGB color raw image (pixel values represented as...) Convert to HSV color space and extract the H component image. The metal and background are initially separated. The conversion formula is as follows: In the formula, R is the value of the red channel; G is the value for the green channel; B is the value for the blue channel; H stands for hue, which indicates the type of color (such as red, yellow, green, and blue). S represents saturation, and V represents brightness. Understandably, illumination normalization can be achieved in various ways. For example, algorithms based on Retinex theory model an image as the product of reflection and illumination components, enhancing image detail and consistency by estimating and removing the illumination component. Adaptive histogram equalization improves overall contrast while suppressing local over-enhancement and noise amplification by dividing the image into blocks and performing contrast-limited histogram equalization. Gamma correction adjusts the overall brightness distribution by performing nonlinear transformations on image intensity to improve visual perception or adapt to display characteristics. In practical processing, appropriate preprocessing methods can be selected based on the specific pattern of image illumination unevenness, the reflective properties of metal surfaces, and subsequent processing requirements, thus providing a more reliable image foundation for subsequent edge detection and contour extraction.
[0094] In some embodiments, illumination normalization processing includes: Divide the color component image into multiple non-overlapping sub-blocks; Calculate the grayscale histogram for each sub-block, and allocate the number of pixels in the grayscale histogram that exceed a preset threshold to other grayscale levels; Each processed sub-block is merged using bilinear interpolation.
[0095] In this embodiment, by dividing the color component image into multiple non-overlapping sub-blocks, the uneven illumination problem of the overall image can be decomposed into local sub-block illumination adjustments. This allows each sub-block to be processed independently according to its own illumination characteristics, avoiding the problem of some areas being too bright or too dark due to global processing. The grayscale histogram of each sub-block is calculated, and the number of pixels exceeding a preset threshold is distributed to other grayscale levels to avoid over-amplifying noise. The processed sub-blocks are then merged using bilinear interpolation, weakening overly bright areas caused by reflections and overly dark areas caused by shadows, resulting in a more balanced overall grayscale distribution of the image and clearly revealing the texture details of the metal surface.
[0096] Specifically, in one embodiment, the color component image is... The CLAHE algorithm is applied for local contrast enhancement, dividing the image into sections. There are 3 non-overlapping sub-blocks, each with a size of 1. .
[0097] For each sub-block, a grayscale histogram is calculated, and a contrast threshold (T=20) is set to distribute pixel values exceeding the threshold evenly to other grayscale levels. The sub-blocks are then stitched together using bilinear interpolation to obtain an illumination-normalized image. .
[0098] Understandably, adaptive binarization can be implemented in various ways, such as threshold calculation methods based on local pixel neighborhoods. For example, the NiBlack algorithm dynamically determines the threshold by calculating the mean and standard deviation of the neighborhood around each pixel, making it suitable for images with uneven lighting. The Sauvola algorithm introduces dynamic coefficients based on the NiBlack algorithm, further optimizing threshold selection in low-contrast regions. The Bernsen algorithm determines the threshold by comparing the average of the maximum and minimum gray values within the pixel neighborhood, exhibiting good adaptability to different contrast regions. In practical applications, a suitable adaptive binarization algorithm can be selected based on the specific characteristics of the metal image (such as surface reflectivity and background complexity) to achieve accurate separation of the metal foreground and background.
[0099] In some embodiments, adaptive binarization processing includes: For each pixel in the image after illumination normalization, the binarization threshold is dynamically calculated based on its local gray mean, local gray standard deviation and the global maximum standard deviation of the image. The grayscale value of each pixel is compared with its corresponding dynamic threshold to generate a binary image, where pixels that are higher than or equal to the threshold are marked as the first background and pixels that are lower than the threshold are marked as the second background.
[0100] In this embodiment, by dynamically calculating the binarization threshold by combining the local gray-level mean, local gray-level standard deviation, and the global maximum standard deviation of the image, the local gray-level characteristics and overall gray-level distribution features of different regions of the image can be fully considered, making the threshold determination more targeted and adaptable. Compared with fixed thresholds or threshold calculation methods that rely solely on local information, this approach can not only effectively handle local gray-level fluctuations caused by reflection and texture differences on the metal surface, but also constrain the local threshold through the global maximum standard deviation, avoiding excessive influence of extreme local gray-level values on the threshold calculation. This allows for more accurate separation of the metal foreground and background under complex lighting and background conditions. After comparing the gray-level value of each pixel with its corresponding dynamic threshold, a binary image is generated. Pixels higher than or equal to the threshold are marked as the first background, and pixels lower than the threshold are marked as the second background. This binarization method clearly highlights the outline of the metal from the complex background, providing a high-contrast image foundation for subsequent edge detection and contour extraction, and effectively reducing the interference of non-target areas on subsequent processing.
[0101] Specifically, in one embodiment, the image after illumination normalization (e.g.) Binarization is performed, and the threshold for each pixel is dynamically determined: in, for The average gray value of the local window centered on [the value]. Standard deviation of grayscale within the window is the global maximum standard deviation of the image, and k is the correction coefficient. The binarization result is: In the formula, Indicates a metallic background. Indicates the background of the tray.
[0102] It is understandable that noise reduction can be achieved in various ways, such as morphological operations (e.g., opening and closing operations) to eliminate small noise points, smooth contour edges, or fill holes within contours; connected component analysis, by marking and filtering connected regions whose area, perimeter, and other features meet preset conditions, can remove isolated noise blocks with excessively small areas; region growing methods start from seed points and merge pixels to form regions according to similarity criteria, effectively distinguishing target regions from noise regions. In practical applications, single or combined noise reduction methods are usually selected based on the type of noise (e.g., Gaussian noise, impulse noise, etc.) and the specific characteristics of the image, in order to remove noise interference to the maximum extent while preserving the key contour information of the metal. In some embodiments, noise reduction includes: performing morphological opening operations on the binarized image; performing morphological closing operations on the image after opening operations; and performing connected component analysis on the image after closing operations to filter connected regions with an area greater than a preset area threshold. In this embodiment, morphological opening operation processing (erosion followed by dilation) can effectively remove small isolated noise points and fine interference burrs in the binarized image while basically maintaining the shape of the metal body contour. Morphological closing operation processing (dilation followed by erosion) can fill in possible tiny holes and depressions at the contour edges inside the metal contour, making the contour smoother and more complete. Connected region analysis calculates the area of each connected region and filters out connected regions with an area greater than a preset area threshold. This can further eliminate small noise regions that may still remain after opening and closing operations, ensuring that the main connected regions of the metal are retained. This significantly improves the signal-to-noise ratio of the preprocessed image and lays a solid foundation for the subsequent accurate extraction of metal edges and contours.
[0103] In some embodiments, noise reduction processing includes bilateral filtering.
[0104] In this embodiment, bilateral filtering is used for noise reduction, which effectively suppresses noise while preserving the edge details of the metal to the greatest extent. The core principle of bilateral filtering is that its weight calculation considers not only the spatial distance between pixels (such as the spatial domain weight of Gaussian filtering) but also the similarity of pixel gray values (range domain weight). For metal images, the edge regions are often accompanied by significant gray value jumps, while noise usually manifests as isolated gray value anomalies. When calculating the output value of a pixel, bilateral filtering assigns higher weights to pixels that are spatially close and have gray values similar to the center pixel, and lower weights to pixels that are spatially far away or have large gray value differences (such as pixels on both sides of the edge or noise points). This characteristic allows bilateral filtering to smooth noise in uniform areas within the image without blurring the edge contours of the metal, avoiding the edge information loss problem that may occur during the noise reduction process of traditional methods such as Gaussian filtering.
[0105] Specifically, in one embodiment, bilateral filtering is used instead of traditional Gaussian blurring to suppress noise while preserving metallic edges. The filtering formula is as follows: In the formula, The filtering window is centered at (x, y); Gaussian function in the spatial domain: d is the spatial distance. Options 3-5.
[0106] Gaussian function for grayscale: d represents the grayscale difference. 20-30 is an option.
[0107] Normalization coefficients: It is understandable that edge detection can be achieved in various ways. For example, the Canny edge detection algorithm achieves high-precision edge extraction through multi-stage processing (Gaussian filtering for noise reduction, calculating gradient magnitude and direction, non-maximum suppression for edge refinement, dual-threshold detection, and edge connection), effectively suppressing noise while preserving clear edge contours. The Sobel operator calculates the gradients of the image in the horizontal and vertical directions to obtain the intensity and direction information of the edges, featuring simple computation and low sensitivity to noise. The Prewitt operator is similar to the Sobel operator but uses an average filter kernel, resulting in a more uniform response to edges. The Laplacian operator detects edges based on the zero-crossing points of the second derivative, which is sensitive to abrupt changes in grayscale but easily affected by noise. In practical applications, a suitable edge detection algorithm can be selected based on the edge characteristics of the metal image (such as whether it is continuous or whether there are burrs), the noise level, and the required edge localization accuracy to accurately extract the contour edges of the metal.
[0108] In some embodiments, the step of performing edge detection on a preprocessed image to obtain edge detection results includes: The gradient of the image is calculated using at least two edge detection operators in different directions; The gradient values of corresponding pixels in each directional gradient map are fused to obtain the edge detection result.
[0109] In this embodiment, by using edge detection operators in at least two different directions to calculate the gradient of the image, the grayscale variation information of metal edges in different directions can be captured more comprehensively. Metal edges may exhibit various orientations such as horizontal, vertical, 45-degree, and 135-degree. Single-directional edge detection operators are often only sensitive to edge responses in a specific direction, easily missing edge details in other directions. Combining edge detection operators in at least two different directions and fusing the gradient values of corresponding pixels in each direction's gradient map—for example, by taking the maximum value of the gradient values in each direction, the square root of the sum of squares, or a weighted sum—can synthesize the edge responses in each direction, resulting in an edge detection result that contains more edge details and responds well to edges in different orientations. This multi-directional gradient fusion method, compared to single-directional operators, can effectively reduce edge detection omissions, especially for subtle texture edges that may exist on the metal surface or irregular edges caused by casting or processing, providing more complete and reliable edge information for subsequent contour extraction and detection point selection.
[0110] Specifically, in one embodiment, the Scharr operator is used to calculate the gradients in the horizontal (0°) and vertical (90°) directions: The filtered image after bilateral filtering is shown above. ; This operator is a 3×3 convolution kernel used to extract the horizontal gray-level change rate of the image, mainly responding to vertical edges; The coefficients in column 1, -3, -10, and -3, indicate that negative weighting is applied to the left-hand pixels of a local region of the image. The coefficients 3, 10, and 3 in column 3 indicate that positive weighting is applied to the right-side pixels of a local region of the image. All coefficients in the middle column are 0, indicating that they do not participate in the weighting of the center column and only highlight the difference in gray levels between the left and right sides; The intermediate row coefficient ±10 is the main weight, used to strengthen the true gradient in the horizontal direction; the up and down row coefficients ±3 are the auxiliary weights, used to smooth noise and suppress single-point mutation interference.
[0111] The Prewitt operator is used to calculate the gradients at 45° and 135°: In the formula, This represents the convolution operation. The filtered image after bilateral filtering is shown above. .
[0112] The 3×3 convolution kernel is used to detect inclined edges at 45° and 135° angles to the horizontal direction; The upper right corner of the matrix is assigned a positive weight, which means that the upper right pixels in the local area of the image are given a positive weight; the lower left corner of the matrix is assigned a negative weight, which means that the lower left pixels in the local area of the image are given a negative weight. The center position coefficient is 0, and it is only used to highlight the grayscale difference in the diagonal direction; (-1, 0, 1) represents the weight values, which reduces computational complexity while ensuring the accuracy of gradient calculation.
[0113] The fused gradient map is obtained by taking the maximum value of the gradient maps in the four directions. The formula is as follows: Understandably, subpixel-level nonmaximum suppression (NVPS) can be implemented in various ways. For example, methods based on quadratic interpolation fit the grayscale values of adjacent pixels along the gradient direction using a quadratic function to find the precise peak position of the gradient magnitude. Centroid-based methods calculate subpixel coordinates by weighting the gradient magnitudes of adjacent pixels along the gradient direction, utilizing the distribution characteristics of grayscale values to improve positioning accuracy. Polynomial interpolation methods construct high-order polynomial models to fit grayscale changes near the edge, thereby achieving subpixel-level edge positioning. In practical applications, a suitable subpixel-level NNVPS method can be selected based on the continuity of the edge, the smoothness of the gradient change, and the computational efficiency requirements, to ensure both edge positioning accuracy and real-time performance.
[0114] In some embodiments, subpixel-level nonmaximum suppression processing includes: The gradient direction of each pixel is determined based on the edge detection results; Interpolate along the gradient direction at the sub-pixel level to find local extrema of the gradient. Only edge points at local extreme points are retained to obtain the suppressed edges.
[0115] In this embodiment, by determining the gradient direction of each pixel based on the edge detection results, interpolation is performed along this gradient direction at the sub-pixel level, enabling more accurate local extrema of the gradient. Specifically, for each candidate edge point in the edge detection results, its gradient direction is first determined (e.g., 0°, 45°, 90°, 135°, or more refined angle divisions), and then the gradient magnitudes of two adjacent pixels in this direction are selected. By performing quadratic function interpolation fitting on the gradient magnitudes of these three points (the current pixel and its two neighboring pixels in the gradient direction), a quadratic function model about the positional offset is constructed, and the location of the extremum point of this quadratic function is solved. The x-coordinate of this extremum point is the sub-pixel level edge position. Only edge points at the local extrema points of the gradient obtained through interpolation are retained, while edge points at non-maximum points are suppressed, thereby refining the original pixel-level edge contour to the sub-pixel level, significantly improving the accuracy of edge localization, and providing higher-resolution edge base data for subsequent contour fitting and accurate selection of detection points. This processing method effectively avoids edge positioning errors and jagged effects that may be caused by traditional pixel-level non-maximum suppression, making the extracted metal edges smoother, more continuous, and more precisely positioned.
[0116] Specifically, in one embodiment, the edge detection results (e.g., fused gradient maps) are processed. ), calculate the gradient direction for each pixel. It is then quantized into 8 directions, along the gradient direction. Get the current pixel Neighboring pixels on both sides and The precise location of the gradient maximum is calculated using quadratic interpolation. :set up , , The interpolation function is Solving for the extreme points yields the results. The corresponding sub-pixel offset; if If the maximum value is within the interpolation interval, then retain it. If a pixel is used as an edge point, it is otherwise suppressed to obtain a sub-pixel level edge map. (i.e., the edges after suppression processing).
[0117] In some embodiments, the step of filtering the target outline of the metal from continuous edge segments includes: Calculate the area, aspect ratio, and convexity of each closed contour in a continuous edge segment, and filter out the target contour according to a preset range.
[0118] In this embodiment, by calculating the area, aspect ratio, and convexity of each closed contour in a continuous edge segment, and filtering target contours according to a preset range, the contour region where the metal is located can be accurately located. Specifically, the area calculation is achieved by counting the number of pixels contained in the closed contour. As a detection object with fixed specifications, the projected area of metal in the image usually falls within a relatively stable preset range. The aspect ratio is calculated by first determining the minimum bounding rectangle of the closed contour using the minimum bounding rectangle algorithm. As an approximate cuboid structure, the aspect ratio of metal at a standard shooting angle usually conforms to a specific range. The convexity calculation is achieved by determining whether the closed contour is a convex polygon. By setting a convexity threshold, contours that conform to the morphological characteristics of metal can be further filtered out. In practical applications, combining the three feature parameters of area, aspect ratio, and convexity for filtering can accurately identify the target contour of the metal, providing a reliable contour basis for the selection of subsequent detection points.
[0119] Specifically, in one embodiment, for continuous edge segments (e.g.) An 8-pass contour extraction algorithm was used to obtain all closed contours. For each contour Calculate and filter based on the following features: area Aspect Ratio : Calculate the length of the minimum bounding rectangle of the profile Hekuan ,satisfy convexity Calculate the area of the convex hull of the contour With contour area ratio ,satisfy The contour that meets the above characteristics is retained as the metal contour. (i.e., the target contour), the center coordinates of its smallest bounding rectangle and rotation angle This refers to the position and orientation of the metal.
[0120] It is understandable that test points can be implemented in various ways. For example, intelligent selection of test points can be achieved through neural network model training. This involves training a large number of metal image samples containing different specifications, surface features, and defects using a pre-trained deep learning algorithm. This allows the neural network model to autonomously learn the optimal distribution pattern of test points on the metal surface and adaptively output the coordinates of the test points based on the actual morphological characteristics of the metal (such as surface texture, potential defect areas, geometric center, etc.). Alternatively, standardized selection of test points can be achieved through a pre-set rule base. For example, based on the geometric parameters of the metal contour (such as length, width, center position), a set of test points can be generated according to rules such as equal-spaced grid division, priority given to key feature points (such as corners, center, and edge midpoints), or focused coverage of defect-sensitive areas. In practical applications, the appropriate test point selection method can be chosen by considering the accuracy requirements of the detection scenario, the detection efficiency requirements, and the individual differences of the metal, to ensure that the test points can comprehensively cover the key areas of the metal surface, providing accurate sampling locations for subsequent component analysis and defect detection.
[0121] In some embodiments, the step of selecting a test point within the area defined by the target contour includes: Calculate the curvature of the sampling points on the target contour and the gradient change in the gradient map; Candidate points are selected based on curvature threshold and gradient mutation threshold; The position range of candidate points is constrained based on the prior length information of the metal. From all candidate points that satisfy the constraints, select the point with the largest product of curvature and gradient change as the test point.
[0122] In this embodiment, by comprehensively considering multi-dimensional features such as curvature, gradient change, and prior metal length information of sampling points on the target contour, accurate selection of metal detection points can be achieved. Reasonable curvature and gradient abruptness thresholds are set, and sampling points with curvature values greater than the curvature threshold and gradient change values greater than the gradient abruptness threshold are selected as candidate points. The location range of the candidate points is constrained by combining the prior metal length information. For all candidate points that meet the above constraints, the product of their curvature value and gradient change value is calculated. This product comprehensively reflects the bending characteristics and grayscale change characteristics of the candidate point. The larger the product, the more likely the point is to be a key detection location on the metal surface. The point with the largest product is selected as the final test point. This multi-feature fusion selection method can effectively eliminate interference factors, accurately capture representative detection areas on the metal surface, and provide accurate location basis for subsequent metal quality inspection.
[0123] Specifically, in one embodiment, the target contour (e.g., a metal contour) Sampling is performed at equal arc length intervals to obtain a sampling point sequence. ,in ; Calculate the curvature of each sampling point : In the formula, , It is a first-order difference (approximately the first-order derivative). , It is a second-order difference (approximately a second-order derivative).
[0124] In curvature ( For the region (where the curvature threshold is defined), calculate the first-order difference of the gradient map. ,reserve ( This is the gradient mutation threshold, which can be selected. Points are selected as candidate detection points based on metal length. The detection points are limited to both ends of the contour. and Within the interval, the final value is taken from the interval. The largest point is selected as the optimal detection point.
[0125] In some embodiments, acquiring cross-sectional spectral data of the metal and calculating the re-inspection purity data of the metal based on the cross-sectional spectral data includes: Control the cutting mechanism to cut the metal and obtain the cross-section of the metal; The control spectral detection module acquires the cross-sectional spectral data of the metal section; The purity data of the metal was calculated based on the cross-sectional spectral data.
[0126] In this embodiment, a cutting mechanism is controlled to cut the metal, obtaining a flat metal cross-section, providing an ideal detection surface for spectral detection. The cutting parameters of the cutting mechanism can be adaptively adjusted according to the metal's material hardness and cross-sectional dimensions to ensure a balance between cross-sectional flatness and cutting efficiency. The spectral detection module is controlled to acquire spectral data from the metal cross-section. The spectral detection module can employ laser-induced breakdown spectroscopy (LIBS) or X-ray fluorescence spectroscopy (XRF) techniques to obtain cross-sectional spectral data containing information on the type and content of metal elements by exciting the atomic emission characteristic spectra on the surface of the metal cross-section. Based on the acquired cross-sectional spectral data, the purity data for metal re-inspection is calculated using a pre-established standard spectral database and quantitative analysis model.
[0127] In some embodiments, after verifying the user's exchange request information and conducting the metal recycling transaction based on the final recycling price information and the payment information, the process includes: The control transfer mechanism transfers the metal in the recovery compartment to a safe, thereby emptying the recovery compartment.
[0128] In this embodiment, by controlling the transfer mechanism to move the metal in the recycling bin to a safe, the recycling bin is left empty, enabling continuous operation of the metal recycling equipment and improving overall recycling efficiency. Specifically, after a metal recycling transaction is completed and the user confirms receipt, the system generates a transfer instruction and sends it to the transfer mechanism. The transfer mechanism can employ various methods such as robotic arm gripping, conveyor belt conveying, or pneumatic pushing, selecting the optimal transfer path based on the size, weight, and shape characteristics of the metal.
[0129] This application also proposes a metal recycling system, including: The identity verification module is used to verify the user's identity information; The initial inspection data acquisition module is used to acquire the weight data and surface spectral data of the metal, and to calculate the initial inspection purity data of the metal based on the surface spectral data. The initial inspection and pricing module is used to calculate the initial recycling price information based on the weight data and the initial inspection purity data of the metal, and output the initial recycling price information. The re-inspection request verification module is used to verify the user's re-inspection request information and payment information; The re-inspection data acquisition module is used to acquire cross-sectional spectral data of the metal and calculate the re-inspection purity data of the metal based on the cross-sectional spectral data. The re-inspection pricing module is used to calculate the final recycling price information based on the weight data of the metal and the re-inspection purity data, and output the final recycling price information. The transaction execution module is used to verify the user's exchange request information and to conduct metal recycling transactions based on the final recycling price information and the payment information.
[0130] It is understood that this metal recycling system has all the beneficial effects of all the embodiments of the above-described metal recycling methods, and will not be elaborated further here.
[0131] In some embodiments, it also includes: The recovery compartment is used to hold metal and can be opened or closed. A weight detection module is installed inside the recycling chamber to collect the weight data of the metal; A spectral detection module, located inside the recovery chamber, is used to collect surface spectral data and cross-sectional spectral data of the metal.
[0132] A cutting mechanism used to cut metal to obtain a cross-section; Safes are used to securely store recycled metals; A transfer mechanism for transferring metal from the recycling bin to the safe.
[0133] In this embodiment, the recycling bin, weight detection module, spectral detection module, cutting mechanism, safe, and transfer mechanism work together to achieve full-process automation and closed-loop management of metal recycling.
[0134] It should be noted that this application is not limited to the above-described embodiments. The above embodiments are merely examples, and any embodiments with the same structure and effect as the technical concept within the scope of this application are included in the technical scope of this application. Furthermore, various modifications that can be conceived by those skilled in the art to the embodiments, and other ways of constructing by combining some of the constituent elements of the embodiments, without departing from the spirit of this application, are also included in the scope of this application.
Claims
1. A metal recovery method characterized by, include: Verify the user's identity information; Obtain the weight data and surface spectral data of the metal, and calculate the initial purity data of the metal based on the surface spectral data; The weight data and initial purity data of the metal are converted into preliminary recycling price information, and the preliminary recycling price information is output. Verify the user's re-inspection request information and payment information; Obtain cross-sectional spectral data of the metal, and calculate the re-inspection purity data of the metal based on the cross-sectional spectral data; The weight data and the re-inspection purity data of the metal are converted into final recycling price information, and the final recycling price information is output. Verify the user's exchange request information, and conduct the metal recycling transaction based on the final recycling price information and the payment information.
2. The metal recovery method according to claim 1, characterized by, The process of acquiring cross-sectional spectral data of the metal and calculating the re-inspection purity data of the metal based on the cross-sectional spectral data includes: Acquire images of metal cross sections; The metal cross-section image is divided into multiple sub-regions, and the feature information of each sub-region is extracted. The feature information is input into a preset metal content prediction model to obtain the predicted metal content value for each sub-region; The predicted metal content values are weighted and fused to obtain the metal content detection results.
3. The metal recovery method according to claim 2, characterized by, The step of segmenting the metal cross-section image into multiple sub-regions and extracting feature information from each sub-region includes: The metal cross-section image is divided into multiple sub-regions, and the spectral intensity data and cross-section thickness data of each sub-region are obtained. Feature information is extracted from the spectral intensity data and the cross-section thickness data.
4. The metal recovery method according to claim 2, characterized by, The acquisition of the metal cross-section image includes: Obtain the raw image containing the metal; The original image is preprocessed to obtain a preprocessed image; Edge detection is performed on the preprocessed image to obtain the edge detection results; The edge detection results are subjected to subpixel-level nonmaximum suppression processing; Connect the suppressed edges to form continuous edge segments; The target outline of the metal is selected from the continuous edge segments, and its location is determined; Based on the target contour, select a test point within the area it defines; Based on the test points, obtain the cross-sectional image of the metal.
5. The metal recycling method according to claim 4, characterized in that, The step of preprocessing the original image to obtain a preprocessed image includes: The original image is converted to the target color space and the color component image is extracted. The color component image is subjected to illumination normalization processing; Adaptive binarization is performed on the image after illumination normalization. Noise reduction is performed on the binarized image.
6. The metal recycling method according to claim 1, characterized in that, The acquisition of metal weight data and surface spectral data, and the calculation of initial purity data of the metal based on the surface spectral data, includes: Control the opening of the recovery capsule; Verify the user's metal insertion information and control the closing of the recycling bin; The weight detection module is controlled to collect the weight data of the metal, and the spectral detection module is controlled to collect the surface spectral data of the metal; The initial purity data of the metal is calculated based on the surface spectral data.
7. The metal recycling method according to claim 1, characterized in that, The process of acquiring cross-sectional spectral data of the metal and calculating the re-inspection purity data of the metal based on the cross-sectional spectral data includes: Control the cutting mechanism to cut the metal and obtain the cross-section of the metal; The control spectral detection module acquires the cross-sectional spectral data of the metal section; The purity data of the metal was calculated based on the cross-sectional spectral data.
8. The metal recycling method according to claim 6, characterized in that, The process of verifying the user's exchange request information, and then conducting the metal recycling transaction based on the final recycling price information and the payment information, includes: The control transfer mechanism transfers the metal in the recovery compartment to a safe, thereby emptying the recovery compartment.
9. A metal recycling system, characterized in that, include: The identity verification module is used to verify the user's identity information; The initial inspection data acquisition module is used to acquire the weight data and surface spectral data of the metal, and to calculate the initial inspection purity data of the metal based on the surface spectral data. The initial inspection and pricing module is used to calculate the initial recycling price information based on the weight data and the initial inspection purity data of the metal, and output the initial recycling price information. The re-inspection request verification module is used to verify the user's re-inspection request information and payment information; The re-inspection data acquisition module is used to acquire cross-sectional spectral data of the metal and calculate the re-inspection purity data of the metal based on the cross-sectional spectral data. The re-inspection pricing module is used to calculate the final recycling price information based on the weight data of the metal and the re-inspection purity data, and output the final recycling price information. The transaction execution module is used to verify the user's exchange request information and to conduct metal recycling transactions based on the final recycling price information and the payment information.
10. The metal recycling system according to claim 9, characterized in that, Also includes: The recovery compartment is used to hold metal and can be opened or closed. A weight detection module is installed inside the recycling chamber to collect the weight data of the metal; A spectral detection module is installed inside the recovery chamber to collect surface spectral data and cross-sectional spectral data of the metal. A cutting mechanism used to cut metal to obtain a cross-section; Safes are used to securely store recycled metals; A transfer mechanism for transferring metal from the recycling bin to the safe.