Metal detection method for real-time correction of product status

By calculating the principal and secondary feature vectors of the product signal point set, rotating and aligning them, and generating a dynamic threshold, the problem of decreased detection accuracy and high false alarm rate caused by changes in product state in the prior art is solved, and high-sensitivity detection is achieved under non-stop conditions.

CN120928474BActive Publication Date: 2026-07-24TECHIK INSTR SHANGHAI
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TECHIK INSTR SHANGHAI
Filing Date
2025-08-15
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing metal detectors struggle to achieve real-time adaptive and high-sensitivity detection without shutting down when faced with slow changes in product conditions, resulting in high false alarm and false negative rates. Furthermore, they have complex hardware and software requirements and high maintenance costs.

Method used

By collecting product signal point sets to calculate the geometric center, determining the main and secondary feature vectors, rotating and aligning them, and statistically calculating the average rotation angle and threshold in the buffer, the horizontal and vertical judgment thresholds are dynamically generated, realizing real-time correction of product status and online adaptation of detection parameters.

Benefits of technology

It enables dynamic adjustment of detection parameters without stopping the machine, reducing false alarm rate, maintaining detection accuracy, reducing hardware and software complexity, and is suitable for continuous industrial production environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120928474B_ABST
    Figure CN120928474B_ABST
Patent Text Reader

Abstract

The application discloses a metal detection method for real-time correction of product state, comprising: collecting a detection point set of a measured product when the product passes through a probe and calculating a geometric center; extracting a main feature vector and a secondary feature vector orthogonal to the main feature vector based on an Euclidean distance; rotating and aligning in the direction of the main vector and extracting main / secondary direction components after rotation, taking the components and an angle between the main vector as features for recording and caching; calculating an effective average rotation angle and horizontal and vertical judgment thresholds based on a number of qualified records in the cache; translating the point set of a product to be measured and rotating to an aligned coordinate system according to the effective average angle, and comparing the point set after rotation with the effective threshold to determine whether the product is qualified or not. The method realizes online adaptive updating of the threshold based on the nearest qualified sample, can correct in real time under the condition of no shutdown along with the slow change of the product state, reduces false positives and maintains detection sensitivity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of detection technology, specifically relating to a metal detection method for real-time correction of product status. Background Technology

[0002] A metal detector is a device that uses changes in the electromagnetic field within a probe window to detect foreign objects passing through a conveyor line. Its working principle is generally as follows: a transmitting coil converts an electrical signal into an alternating electromagnetic field, which is then excited into a field distribution within the probe window; a receiving coil senses minute disturbances in the field and sends the received electrical signal to a signal processing unit at the back end. After amplification, filtering, spectral analysis, or other processing, a detection criterion is formed and used to determine foreign objects (especially metallic foreign objects). In conventional applications, metal detectors rely on static or semi-static calibration results from qualified products to set detection parameters and thresholds.

[0003] In the prior art, Chinese patent CN118884539A discloses an intelligent detection method and system for a metal detector. This method includes: preparing pre-recorded images of the product, including at least images of qualified products; acquiring feature vectors of multiple frequencies of the product; obtaining a feature image based on the feature vectors; and the metal detector processing the feature image, comparing it with the pre-recorded image, and outputting the product's detection judgment result. However, this method places higher demands on hardware and real-time computing capabilities, and typically requires complex software (image processing, classifiers, similarity evaluation, etc.), increasing system integration and maintenance costs.

[0004] Existing technologies still have significant shortcomings in industrial applications, mainly in the following aspects:

[0005] 1. Traditional metal detectors typically use pre-calibrated equipment parameters and judgment thresholds during production. Once these parameters are set, they cannot be dynamically adjusted without stopping the machine. Faced with slow changes in product types, formulas, or conditions, the equipment lacks an automatic adaptation mechanism and can only rely on manual shutdown for maintenance or recalibration to restore performance, resulting in long downtime and reduced production efficiency.

[0006] 2. For products whose state changes slowly over time (e.g., changes in water content / conductivity of frozen meat during thawing, changes in physical properties of high-temperature sauces during cooling), the product's response to the probe's electromagnetic field will drift over time. A fixed threshold may be suitable for a certain state during calibration, but when the product's state changes, a product that was originally qualified may be misjudged as containing foreign matter (false alarm), or the detection sensitivity may be artificially reduced to avoid false alarms, leading to an increased risk of missed detections.

[0007] 3. Signal offsets caused by changes in the product's own state often have confusion with disturbances caused by small metallic foreign objects in terms of amplitude or direction. Existing judgment strategies mostly rely on a single threshold or simple features, which cannot reliably separate the two types of factors, increasing the uncertainty of the judgment.

[0008] In summary, existing technologies have not yet provided a method that can operate online, adapt in real time, and maintain detection accuracy while dealing with slow changes in product status and maintaining high sensitivity and low false alarm rate. There is an urgent need for a solution that can correct product status in real time, dynamically adjust judgment thresholds, and maintain production continuity without stopping the machine. Summary of the Invention

[0009] The purpose of this invention is to overcome the shortcomings of the prior art and provide a metal detection method for real-time correction of product status.

[0010] The objective of this invention can be achieved through the following technical solutions:

[0011] This invention provides a metal detection method for real-time correction of product status, comprising the following steps:

[0012] Collect the set of detection signal points when the product under test passes through the probe, calculate the geometric center, and determine the principal feature vector and the secondary feature vector orthogonal to it based on the Euclidean distance;

[0013] The principal feature vector and the secondary feature vector are rotated and aligned according to the angle between the principal feature vector and the reference direction of the principal feature vector to obtain the principal direction component and the secondary direction component in the aligned coordinate system. The principal direction component, the secondary direction component and the angle between the principal feature vector directions are recorded as features to be buffered in the buffer.

[0014] Based on several feature records stored in the buffer, calculate the effective average rotation angle and the effective horizontal and vertical judgment thresholds;

[0015] After translating the detection signal point set of the product to be judged relative to the geometric center, it is rotated to the aligned coordinate system according to the effective average rotation angle. It is then determined whether the point set after rotation falls entirely within the judgment area defined by the effective horizontal and vertical judgment thresholds, thereby realizing the detection of the product under test.

[0016] Furthermore, the computational geometric center specifically includes:

[0017] Collect the coordinates (x, y) of all sampling points in the detection signal point set when the product under test passes through the probe. i ,y i And calculate the geometric center of the detection signal point set based on the coordinates of all sampling points:

[0018]

[0019]

[0020] Among them, (x i ,y i Let ) represent the x and y coordinates of the i-th detection signal point in the original coordinate system, and M represent the total number of sampling points in the detection signal point set. x ,c y ) represents the geometric center coordinates of the set of detection signal points.

[0021] Furthermore, the calculation process for the principal feature vector includes:

[0022] The coordinates (x, y) of each sampling point in the detection signal point set i ,y i ) and geometric center coordinates (c x ,c y Subtracting the first two, we get the translated coordinates (x′). i ,y′ i ), and calculate the Euclidean distance d from the translated coordinate point to the origin. i :

[0023]

[0024] Where, d i Let be the Euclidean distance of the i-th detection signal point relative to the geometric center;

[0025] Choose Euclidean distance d i The largest point (x′) k ,y′ k The principal eigenvector is formed with the geometric center as its starting point, serving as the endpoint of the principal eigenvector.

[0026] The components of the principal feature vector along the horizontal and vertical axes of the original coordinate system are defined as follows:

[0027] PXM=x′ k

[0028] PYM=y′ k

[0029] Wherein, PXM and PYM are the component values ​​of the principal feature vector in the horizontal and vertical directions, respectively.

[0030] Furthermore, the calculation process for the secondary eigenvector includes:

[0031] With the principal feature vector For reference, construct a unit vector orthogonal to it.

[0032]

[0033] The translated coordinates (x′) of each point in the detection signal set i ,y′ i Projected onto the unit vector The projection length t of each translated coordinate in the secondary direction is obtained above. i :

[0034] t i =x′ i ·u Nx +y′ i ·u Ny

[0035] Among them, u Nx u Ny They are unit vectors The horizontal and vertical components;

[0036] Calculate the absolute value of all projected lengths and select the projection point (x′) with the largest absolute value. m ,y′ m As the endpoint of the secondary eigenvector, the secondary eigenvector is formed with the geometric center as the starting point.

[0037] The components of the sub-feature vector in the horizontal and vertical directions of the original coordinate system are defined as follows:

[0038] PXA=x′ m

[0039] PYA=y′ m

[0040] Wherein, PXA and PYA are the component values ​​of the secondary feature vector in the horizontal and vertical directions, respectively.

[0041] Furthermore, the reference direction is the x-axis direction;

[0042] The angle between the principal characteristic vector and the direction of the principal characteristic vector in the reference direction is given by the formula:

[0043]

[0044] Where θ is the angle between the directions of the principal feature vector and PXM and PYM are the component values ​​of the principal feature vector in the horizontal and vertical directions, respectively.

[0045] Furthermore, the calculation process for the principal direction component includes:

[0046] The main feature vector of the product to be judged Rotating by an angle θ between the principal characteristic vector directions yields the principal direction components in the rotated aligned coordinate system, and their calculation formula is as follows:

[0047]

[0048] Wherein, PXM′ and PYM′ are the horizontal and vertical components of the principal direction component, respectively, and PXM and PYM are the component values ​​of the principal feature vector in the horizontal and vertical directions, respectively.

[0049] Furthermore, the calculation process for the secondary direction component includes:

[0050] The secondary feature vector of the product to be judged Rotating by an angle θ between the principal characteristic vector directions yields the principal direction components in the rotated aligned coordinate system, and their calculation formula is as follows:

[0051]

[0052] Wherein, PXA′ and PYA′ are the horizontal and vertical components of the secondary direction component, respectively, and PXA and PYA are the component values ​​of the secondary feature vector in the horizontal and vertical directions, respectively.

[0053] Furthermore, the buffer is a queue of size N, used to sequentially store the feature records of the N most recently determined qualified products. Each feature record includes the horizontal axis component PXM′ of the main direction component, the vertical axis component PYA′ of the secondary direction component, and the included angle θ of the main feature vector direction of the qualified product; where N is a preset parameter; when the buffer is full, the newly generated qualified product feature record replaces the earliest stored data according to the first-in-first-out principle.

[0054] Furthermore, the calculation of the effective average rotation angle and the effective horizontal and vertical judgment thresholds based on several feature records stored in the buffer specifically includes:

[0055] Calculate the average angle between the directions of all the principal feature vectors stored in the buffer to obtain the effective average rotation angle.

[0056]

[0057] Where N is the number of characteristic records cached in the buffer, θ i The angle between the directions of the principal feature vectors of the i-th feature record;

[0058] Calculate the average value of the primary direction component horizontal axis component PXM′ and the average value of the secondary direction component vertical axis component PYA′ stored in the buffer. Based on these average values, calculate the effective horizontal and vertical judgment thresholds using the following formula:

[0059]

[0060] Where, k x k y >1 is a preset empirical coefficient used to adjust the sensitivity of the judgment threshold; T x T y These are the horizontal and vertical judgment thresholds, respectively.

[0061] Furthermore, the step of rotating to the aligned coordinate system according to the effective average rotation angle, and determining whether the point set after rotation falls entirely within the judgment area defined by the effective horizontal and vertical judgment thresholds, to achieve the detection of the tested product, specifically includes:

[0062] Based on the effective average rotation angle Rotate the translated set of detection signal points to the aligned coordinate system to obtain the rotated coordinates (x″). i ,y″ i ):

[0063]

[0064] Among them, (x i ′,y i ′) represents the coordinates of the i-th detection signal point in the set of detection signal points after translation;

[0065] The rotated point set is compared with the effective lateral judgment threshold T. x and longitudinal judgment threshold T y Compare the points to determine if the rotated set of points falls entirely within the judgment region:

[0066] |x″ i |≤T X and|y″ i |≤T Y i = 1, 2, ..., M

[0067] Where M is the total number of sampling points contained in the detection signal point set;

[0068] When all points in the detection signal point set fall within the judgment area, the tested product is determined to be a qualified product, and the characteristic record of the tested product is cached in the buffer; when any point does not fall within the judgment area, the tested product is determined to be a non-qualified product.

[0069] Compared with the prior art, the present invention has the following advantages:

[0070] (1) Existing technologies typically employ pre-calibrated static parameters and fixed thresholds. Once these parameters are set, they are difficult to adjust dynamically without stopping the production line. When encountering slow changes in product type, formula, or status, manual recalibration is necessary, leading to long downtime and reduced production line efficiency. This invention extracts the features of each product in real time on the production line (including the principal feature vector determined based on Euclidean distance and its orthogonal secondary feature vector), records the representative components after rotation and alignment in the direction of the principal vector as feature data, and dynamically generates the effective threshold by online statistical analysis of the average rotation angle and average feature amplitude using a sliding queue (the N most recent products judged as qualified), thereby achieving online adaptive updating of the threshold. Thus, this invention eliminates the need for frequent downtime recalibration, automatically adjusts the detection parameters according to the slow changes in product status under continuous production conditions, ensures production line continuity, and significantly reduces production losses caused by manual intervention and downtime.

[0071] (2) For products such as frozen meat and high-temperature sauces, whose physical properties (temperature, moisture content, viscosity, etc.) drift slowly over time, fixed thresholds often cannot cover subsequent states during calibration, leading to misjudgments of qualified products or forced reduction of sensitivity resulting in missed detections. This invention specifically deconstructs the product signal in the "primary direction" and "secondary direction": the principal vector is obtained by using the maximum point of the Euclidean modulus; the secondary vector is found in its orthogonal direction; and the principal vector is rotated to the reference direction (x-axis) to obtain the horizontal component of the principal direction and the vertical component of the secondary direction after rotation. Then, the average value of qualified samples in recent years is multiplied by an adjustable empirical coefficient to form the horizontal and vertical thresholds. This technical feature allows the threshold to be adjusted smoothly and gradually with the overall state of the product, and can compensate for baseline shifts caused by product state drift in real time, thereby significantly reducing the false alarm rate without drastically reducing detection sensitivity.

[0072] (3) Baseline drift caused by changes in product state is often confused with disturbances from small metallic foreign objects in terms of amplitude or direction. Traditional methods relying on single thresholds or full-frame image matching are difficult to reliably distinguish between the two, resulting in high uncertainty in judgment. This invention decomposes the principal / sub-vectors and compares the principal and sub-direction components separately in a rotated and aligned coordinate system. At the same time, it uses a buffer to accept only "qualified" samples for statistical purposes, forming a robust estimate of the threshold and angle. This allows it to distinguish between systematic shifts caused by changes in the overall product state and sudden local disturbances from foreign objects. This technical feature improves the ability to distinguish between real foreign object signals and product effects, reduces judgment uncertainty, maintains the detection sensitivity for small metallic foreign objects, and further suppresses false alarms caused by changes in the product itself.

[0073] (4) Existing technologies use multi-frequency feature vectors to generate feature images, and then determine the product status through image preprocessing, feature extraction, target recognition, and similarity comparison with pre-recorded images. This process involves numerous matrix operations, image correlation calculations, and classifier judgments, requiring high real-time computing power, complex system integration, and high maintenance costs. This invention decomposes and rotates the product signal along the main / secondary vector directions, dynamically generating thresholds by calculating only the horizontal and vertical components of the main and secondary directions and the statistical mean of the sliding queue. It eliminates the need to generate high-dimensional feature images or perform complex image matching and classification operations, thus significantly reducing real-time computation and data storage requirements. This enables real-time adaptation to product status drift while maintaining detection accuracy. Therefore, this invention outperforms existing technologies in terms of hardware requirements, algorithm complexity, and system maintenance, making it more suitable for continuous industrial production environments. Attached Figure Description

[0074] Figure 1 This is a flowchart of a metal detection method according to an embodiment of the present invention;

[0075] Figure 2 This is a schematic diagram of the translated signal point set according to an embodiment of the present invention;

[0076] Figure 3 This is a schematic diagram of the principal and secondary feature vectors in the signal point set according to an embodiment of the present invention;

[0077] Figure 4 This is a schematic diagram of the rotated signal point set according to an embodiment of the present invention. Detailed Implementation

[0078] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0079] Example 1:

[0080] On the production line, metal detectors typically operate with pre-calibrated equipment parameters and thresholds. When the state of the inspected product changes slowly over time (e.g., the moisture content / conductivity of frozen meat changes with thawing time; the viscosity or dielectric constant of high-temperature sauces changes during transport / cooling), qualified products that pass through the probe at different times within the same batch will exhibit different forms on the two-dimensional signal output by the probe.

[0081] Taking frozen meat as an example: when frozen meat from the same batch is initially frozen and partially thawed later, the signal point cloud collected by the probe will experience an overall shift and change in orientation on the coordinate system. The magnitude of the principal feature vector (representing the "farthest point" of the signal region) and its angle with the x-axis will both change over time. For a system with a fixed threshold, this slow drift can lead to: after a period of time, products that were originally qualified may be misjudged as containing foreign objects (false alarms); to suppress false alarms, sensitivity is often forced to be reduced, thereby increasing the risk of missed alarms.

[0082] Therefore, to address the aforementioned technical problems, this embodiment provides a metal detection method for real-time correction of product status, such as... Figure 1 As shown, it includes the following steps:

[0083] Step S1: Collect the set of detection signal points when the product under test passes through the probe, calculate the geometric center, and determine the principal feature vector and the secondary feature vector orthogonal to it based on the Euclidean distance;

[0084] Specifically, the computational geometric center includes:

[0085] Collect the coordinates (x, y) of all sampling points in the detection signal point set when the product under test passes through the probe. i ,y i ), and calculate the geometric center of the detection signal point set based on the coordinates of all sampling points:

[0086]

[0087]

[0088] Among them, (x i ,y i Let ) represent the x and y coordinates of the i-th detection signal point in the original coordinate system, and M represent the total number of sampling points in the detection signal point set. x ,c y ) represents the geometric center coordinates of the set of detection signal points.

[0089] The principal eigenvector is calculated as follows:

[0090] The coordinates (x, y) of each sampling point in the detection signal point set i ,y i ) and geometric center coordinates (c x ,c y Subtracting the first two, we get the translated coordinates (x′). i ,y′ i ), and calculate the Euclidean distance d from the translated coordinate point to the origin. i :

[0091]

[0092] Where, d i Let be the Euclidean distance of the i-th detection signal point relative to the geometric center;

[0093] Choose Euclidean distance d i The largest point (x′) k ,y′ k The principal eigenvector is formed with the geometric center as its starting point, serving as the endpoint of the principal eigenvector.

[0094] The components of the principal eigenvector along the horizontal and vertical axes of the original coordinate system are defined as follows:

[0095] PXM=x′ k

[0096] PYM=y′ k

[0097] Wherein, PXM and PYM are the component values ​​of the principal feature vector in the horizontal and vertical directions, respectively.

[0098] The secondary eigenvector is calculated as follows:

[0099] With principal eigenvectors For reference, construct a unit vector orthogonal to it.

[0100]

[0101] The translated coordinates (x′) of each point in the detection signal set i ,y′ i Projected onto a unit vector The projection length t of each translated coordinate in the secondary direction is obtained above. i :

[0102] t i =x′ i ·u Nx +y′ i ·u Ny

[0103] Among them, u Nx u Ny They are unit vectors The horizontal and vertical components;

[0104] Calculate the absolute value of all projected lengths and select the projection point (x′) with the largest absolute value. m ,y′ m As the endpoint of the secondary eigenvector, the secondary eigenvector is formed with the geometric center as the starting point.

[0105] The components of the secondary feature vector along the horizontal and vertical axes of the original coordinate system are defined as follows:

[0106] PXA=x′ m

[0107] PYA=y′ m

[0108] Wherein, PXA and PYA are the component values ​​of the secondary feature vector in the horizontal and vertical directions, respectively.

[0109] like Figure 2 As shown, this is a schematic diagram of the detection signal point set of the present invention after translation on the coordinate axis, as follows. Figure 3 The figure shows the principal feature vector obtained in this invention. with secondary eigenvectors Among them, as the product status changes, the main feature vector The magnitude and included angle θ of the signal change continuously, making it difficult to statistically analyze signals from less common products under normal circumstances. Directly using static thresholds on the original coordinate system makes it challenging to balance sensitivity and false alarm rate. Therefore, it is necessary to rotate and align the detection signal along the principal vector direction, ensuring the principal vector is parallel to the horizontal axis after rotation. This "de-directionizes" the influence of directional changes, facilitating the description of the signal region using thresholds for both horizontal and vertical components for stable determination.

[0110] Step S2: Rotate and align the principal feature vector and the secondary feature vector according to the angle between the principal feature vector and the reference direction of the principal feature vector to obtain the principal direction component and the secondary direction component in the aligned coordinate system, and record the principal direction component, the secondary direction component and the angle between the principal feature vector directions as features to be buffered in the buffer.

[0111] The reference direction is the x-axis direction;

[0112] The angle between the principal eigenvector and the principal eigenvector direction of the reference direction is given by the formula:

[0113]

[0114] Where θ is the angle between the directions of the principal feature vector and PXM and PYM are the component values ​​of the principal feature vector in the horizontal and vertical directions, respectively.

[0115] The calculation process for the principal direction component includes:

[0116] The main feature vector of the product to be judged Rotating by an angle θ between the principal characteristic vector directions yields the principal direction components in the rotated aligned coordinate system, and their calculation formula is as follows:

[0117]

[0118] Where PXM′ and PYM′ are the horizontal and vertical components of the principal direction component, respectively, and PXM and PYM are the component values ​​of the principal feature vector in the horizontal and vertical directions, respectively. The rotated PYM... i ′ is 0;

[0119] The calculation process for the secondary direction component includes:

[0120] The secondary feature vector of the product to be judged Rotating by an angle θ between the principal characteristic vector directions yields the principal direction components in the rotated aligned coordinate system, and their calculation formula is as follows:

[0121]

[0122] Where PXA′ and PYA′ are the horizontal and vertical components of the secondary direction component, respectively, and PXA and PYA are the component values ​​of the secondary feature vector in the horizontal and vertical directions, respectively. The rotated PXM i ′ is 0;

[0123] like Figure 4 The diagram shows the result of rotating the point set according to the angle θ between the directions of the principal feature vectors. By rotating, the principal and secondary direction components can be obtained. By aligning the principal vectors of each product to the same reference (horizontal axis), signal points that were originally difficult to compare directly due to directional differences can be compared under the same reference system, showing their horizontal and vertical amplitude values. In this way, the statistics and application of the threshold become simple and stable, and the buffer is physically interpretable based on the mean of the most recent qualified samples (the horizontal average represents the typical amplitude of the principal direction, and the vertical average represents the typical amplitude of the horizontal boundary). Figure 4 Visually, the point cloud orientation is chaotic before rotation, but after rotation, the point cloud is effectively described and constrained by a rectangular threshold box.

[0124] Step S3: Based on the several feature records stored in the buffer, calculate the effective average rotation angle and the effective horizontal and vertical judgment thresholds;

[0125] The buffer is a queue of size N, used to store the feature records of the N most recently judged as qualified products in sequence. Each feature record includes the horizontal axis component PXM′ of the main direction component, the vertical axis component PXM′ of the secondary direction component, and the angle θ between the directions of the main feature vectors of the qualified product; where N is a preset parameter; when the buffer is full, the newly generated qualified product feature record replaces the earliest stored data according to the first-in-first-out principle.

[0126] Based on several feature records stored in the buffer, the effective average rotation angle and the effective horizontal and vertical judgment thresholds are calculated, specifically including:

[0127] Calculate the average angle between the directions of all the principal feature vectors stored in the buffer to obtain the effective average rotation angle.

[0128]

[0129] Where N is the number of characteristic records cached in the buffer, θ i The angle between the directions of the principal feature vectors of the i-th feature record;

[0130] Calculate the average value of the primary direction component horizontal axis component PXM′ and the average value of the secondary direction component vertical axis component PYA′ stored in the buffer. Based on these average values, calculate the effective horizontal and vertical judgment thresholds using the following formula:

[0131]

[0132] Where, k x k y >1 is a preset empirical coefficient used to adjust the sensitivity of the judgment threshold; T x T y These are the horizontal and vertical judgment thresholds, respectively.

[0133] Step S4: After translating the detection signal point set of the current product to be judged relative to the geometric center, rotate it to the aligned coordinate system according to the effective average rotation angle, and determine whether the point set after rotation falls entirely within the judgment area limited by the effective horizontal and vertical judgment thresholds, thereby realizing the detection of the product under test.

[0134] Rotate the device to the aligned coordinate system based on the effective average rotation angle, and determine whether the rotated point set falls entirely within the judgment area defined by the effective horizontal and vertical judgment thresholds. This enables the detection of the product under test, specifically including:

[0135] Based on the effective average rotation angle Rotate the translated set of detection signal points to the aligned coordinate system to obtain the rotated coordinates (x″). i ,y″ i ):

[0136]

[0137] Among them, (x i ′,y i ′) represents the coordinates of the i-th detection signal point in the set of detection signal points after translation;

[0138] The rotated point set is compared with the effective lateral judgment threshold T. x and longitudinal judgment threshold T yCompare the points to determine if the rotated set of points falls entirely within the judgment region:

[0139] |x″ i |≤T X and|y″ i |≤T Y i = 1, 2, ..., M

[0140] Where M is the total number of sampling points contained in the detection signal point set;

[0141] When all points in the detection signal point set fall within the judgment area, the tested product is determined to be a qualified product, and the characteristic record of the tested product is cached in the buffer; when any point does not fall within the judgment area, the tested product is determined to be a non-qualified product.

[0142] Example 2:

[0143] This embodiment provides a metal detection system for real-time correction of product status, including:

[0144] Probe unit: includes transmitting and receiving coils, used to generate an electromagnetic field within the probe window and collect field disturbance signals as the product under test passes through.

[0145] Signal acquisition module: Amplifies, filters and digitizes the analog signal output from the receiving coil, and outputs a discrete set of detection points for subsequent processing.

[0146] Preprocessing and centroid calculation unit: Calculates the geometric center of the collected point set and translates the point set to a relative coordinate system with the geometric center as the origin, to obtain the translated point set.

[0147] Main / Secondary Feature Vector Extraction Unit: In the translated coordinate system, it identifies the main feature vector (i.e., the vector corresponding to the farthest end of the region) representing the main direction of the signal region and the secondary feature vector (used to characterize the lateral boundary) in the direction orthogonal to it, and outputs their respective component information.

[0148] Orientation angle calculation unit: Calculates the angle between the main feature vector and the system reference direction based on the orientation information of the main feature vector, and uses it as the orientation feature of this product.

[0149] Rotation Alignment Unit: Perform coordinate system alignment transformation on the point set or feature vector according to the direction of the principal feature vector, so that the principal feature direction is in the standard reference position in the alignment coordinate system, which facilitates subsequent component comparison and statistics.

[0150] Judgment Unit: Determines whether the aligned point set is qualified or unqualified under the currently effective judgment threshold. The judgment strategy supports both strict single-point over-threshold judgment and robust judgment methods based on the proportion of over-threshold points; it outputs a qualified or unqualified signal based on the judgment result.

[0151] Buffer Management Unit: Adopts a first-in-first-out queue structure. Only when a product is determined to be qualified, the representative feature record of the product (including the main direction component after rotation, the secondary direction component after rotation, and the main vector direction feature) is written into the queue. The queue is used to store the feature records of the most recent qualified samples and has the functions of outlier removal and minimum sample number check.

[0152] Threshold calculation unit: Based on the feature records of the most recent qualified samples stored in the buffer, it performs statistics to generate the currently effective average direction and horizontal / vertical judgment threshold; it supports the use of various robust statistical strategies or exponential smoothing methods to improve the stability and noise resistance of threshold estimation.

[0153] Control execution unit: Controls the rejection mechanism or alarm based on the output of the judgment unit, and triggers the buffer writing and threshold update process when qualified.

[0154] Parameter configuration and management unit: Provides configuration interfaces for system parameters such as sliding window length, minimum number of samples, and decision mode, and supports preset working conditions and remote distribution.

[0155] Log recording and data storage unit: Records the original point cloud, extracted features, judgment results and timestamps for each product, facilitating traceability, analysis and offline optimization.

[0156] Human-machine interface and communication unit: used to display real-time thresholds, determine statistical information, provide parameter adjustment, historical query and data interaction with the upper system.

[0157] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0158] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A metal detection method for real-time correction of product status, characterized in that, Includes the following steps: Collect the set of detection signal points when the product under test passes through the probe, calculate the geometric center, and determine the principal feature vector and the secondary feature vector orthogonal to it based on the Euclidean distance; The principal feature vector and the secondary feature vector are rotated and aligned according to the angle between the principal feature vector and the reference direction of the principal feature vector to obtain the principal direction component and the secondary direction component in the aligned coordinate system. The principal direction component, the secondary direction component and the angle between the principal feature vector directions are recorded as features to be buffered in the buffer. Based on several feature records stored in the buffer, calculate the effective average rotation angle and the effective horizontal and vertical judgment thresholds; After translating the detection signal point set of the product to be judged relative to the geometric center, it is rotated to the aligned coordinate system according to the effective average rotation angle. It is then determined whether the point set after rotation falls entirely within the judgment area defined by the effective horizontal and vertical judgment thresholds, thereby realizing the detection of the product under test.

2. The metal detection method for real-time correction of product status according to claim 1, characterized in that, The computational geometric center specifically includes: Collect the coordinates (x, y) of all sampling points in the detection signal point set when the product under test passes through the probe. i ,y i And calculate the geometric center of the detection signal point set based on the coordinates of all sampling points: Among them, (x i ,y i Let ) represent the x and y coordinates of the i-th detection signal point in the original coordinate system, and M represent the total number of sampling points in the detection signal point set. x ,c y ) represents the geometric center coordinates of the set of detection signal points.

3. The metal detection method for real-time correction of product status according to claim 1, characterized in that, The calculation process for the principal feature vector includes: The coordinates (x, y) of each sampling point in the detection signal point set i ,y i ) and geometric center coordinates (c x ,c y Subtracting the first two, we get the translated coordinates (x′). i ,y′ i ), and calculate the Euclidean distance d from the translated coordinate point to the origin. i : Where, d i Let be the Euclidean distance of the i-th detection signal point relative to the geometric center; Choose Euclidean distance d i The largest point (x′) k ,y′ k The principal eigenvector is formed with the geometric center as its starting point, serving as the endpoint of the principal eigenvector. The components of the principal feature vector along the horizontal and vertical axes of the original coordinate system are defined as follows: PXM=x′ k PYM=y′ k Wherein, PXM and PYM are the component values ​​of the principal feature vector in the horizontal and vertical directions, respectively.

4. A metal detection method for real-time correction of product status according to claim 1 or 3, characterized in that, The calculation process for the secondary feature vector includes: With the principal feature vector For reference, construct a unit vector orthogonal to it. The translated coordinates (x′) of each point in the detection signal set i ,y′ i Projected onto the unit vector The projection length t of each translated coordinate in the secondary direction is obtained above. i : t i =x′ i ·u Nx +y′ i ·u Ny Among them, u Nx u Ny They are unit vectors The horizontal and vertical components; Calculate the absolute value of all projected lengths and select the projection point (x′) with the largest absolute value. m ,y′ m As the endpoint of the secondary eigenvector, the secondary eigenvector is formed with the geometric center as the starting point. The components of the sub-feature vector in the horizontal and vertical directions of the original coordinate system are defined as follows: PXA=x′ m PYA=y′ m Wherein, PXA and PYA are the component values ​​of the secondary feature vector in the horizontal and vertical directions, respectively.

5. The metal detection method for real-time correction of product status according to claim 1, characterized in that, The reference direction is the x-axis direction; The angle between the principal characteristic vector and the direction of the principal characteristic vector in the reference direction is given by the formula: Where θ is the angle between the directions of the principal feature vector and PXM and PYM are the component values ​​of the principal feature vector in the horizontal and vertical directions, respectively.

6. The metal detection method for real-time correction of product status according to claim 1, characterized in that, The calculation process for the principal direction component includes: The main feature vector of the product to be judged Rotating by an angle θ between the principal characteristic vector directions yields the principal direction components in the rotated aligned coordinate system, and their calculation formula is as follows: Wherein, PXM′ and PYM′ are the horizontal and vertical components of the principal direction component, respectively, and PXM and PYM are the component values ​​of the principal feature vector in the horizontal and vertical directions, respectively.

7. The metal detection method for real-time correction of product status according to claim 1, characterized in that, The calculation process for the secondary direction component includes: The secondary feature vector of the product to be judged Rotating by an angle θ between the principal characteristic vector directions yields the principal direction components in the rotated aligned coordinate system, and their calculation formula is as follows: Wherein, PXA′ and PYA′ are the horizontal and vertical components of the secondary direction component, respectively, and PXA and PYA are the component values ​​of the secondary feature vector in the horizontal and vertical directions, respectively.

8. The metal detection method for real-time correction of product status according to claim 1, characterized in that, The buffer is a queue of size N, used to store the feature records of the N most recently judged as qualified products in sequence. Each feature record includes the horizontal axis component PXM′ of the main direction component, the vertical axis component PYA′ of the secondary direction component, and the angle θ between the directions of the main feature vectors of the qualified product; where N is a preset parameter; when the buffer is full, the newly generated qualified product feature record replaces the earliest stored data according to the first-in-first-out principle.

9. The metal detection method for real-time correction of product status according to claim 1, characterized in that, The calculation of the effective average rotation angle and the effective horizontal and vertical judgment thresholds based on several feature records stored in the buffer specifically includes: Calculate the average angle between the directions of all the principal feature vectors stored in the buffer to obtain the effective average rotation angle. Where N is the number of characteristic records cached in the buffer, θ i The angle between the directions of the principal feature vectors of the i-th feature record; Calculate the average value of the primary direction component horizontal axis component PXM′ and the average value of the secondary direction component vertical axis component PYA′ stored in the buffer. Based on these average values, calculate the effective horizontal and vertical judgment thresholds using the following formula: Where, k x k y >1 is a preset empirical coefficient used to adjust the sensitivity of the judgment threshold; T x T y These are the horizontal and vertical judgment thresholds, respectively.

10. The metal detection method for real-time correction of product status according to claim 1, characterized in that, The process of rotating to the aligned coordinate system according to the effective average rotation angle, and determining whether the point set after rotation falls entirely within the judgment area defined by the effective horizontal and vertical judgment thresholds, thereby achieving the detection of the product under test, specifically includes: Based on the effective average rotation angle Rotate the translated set of detection signal points to the aligned coordinate system to obtain the rotated coordinates (x″). i ,y″ i ): Among them, (x′ i ,y′ i Let be the coordinates of the i-th detection signal point in the set of detection signal points after translation; The rotated point set is compared with the effective lateral judgment threshold T. x and longitudinal judgment threshold T y Compare the points to determine if the rotated set of points falls entirely within the judgment region: |x″ i |≤T X and|y″ i |≤T Y ,i=1,2,...,M Where M is the total number of sampling points contained in the detection signal point set; When all points in the detection signal point set fall within the judgment area, the tested product is determined to be a qualified product, and the characteristic record of the tested product is cached in the buffer; when any point does not fall within the judgment area, the tested product is determined to be a non-qualified product.