Ejector pin monitoring method and terminal in production process of electric energy meter

By identifying ellipses in the port images of electricity meters and calculating the geometric features of the connecting lines, the accuracy problem of port status detection in electricity meter production was solved, enabling safe insertion of the pin and automated monitoring of the production line, thereby improving production efficiency and quality.

CN121903971APending Publication Date: 2026-04-21FUZHOU WECON ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FUZHOU WECON ELECTRONICS TECH
Filing Date
2025-12-29
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In the current technology, the port status cannot be accurately detected during the production process of electricity meters, the port deformation detection capability is lacking, the false detection rate is high, and the risk of pin damage cannot be prevented.

Method used

By acquiring images of the electricity meter ports, identifying ellipses, calculating the center of the ellipses and fitting a connecting line, and combining geometric features to determine the port status, fully automated monitoring is achieved.

Benefits of technology

It improves the accuracy of port identification, ensures proper insertion of the ejector pin, avoids damage to the port and ejector pin, and improves production efficiency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121903971A_ABST
    Figure CN121903971A_ABST
Patent Text Reader

Abstract

The invention discloses a thimble monitoring method and terminal in an electric energy meter production process, and the method comprises the steps: obtaining an electric energy meter port image, and recognizing an ellipse in the electric energy meter port image; calculating the center of each ellipse, and fitting a connecting line of all the centers; obtaining a port state judgment result according to the geometrical characteristics of the connecting line and the geometrical characteristics of each ellipse; and executing thimble operation according to the port state judgment result. The accuracy of the port state judgment result is ensured by combining verification of the overall states of the multiple ports and verification of the state of the single port, so that the accuracy of judgment of whether the ejector pin can be normally placed into the ports is ensured, damage to the ejector pin or the ports of the electric energy meter is avoided, full-process automatic judgment can be realized, and the efficiency of the electric energy meter is improved. The production efficiency and the production quality of a production line are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition, and more particularly to a method and terminal for monitoring pins during the production process of electricity meters. Background Technology

[0002] Currently, automated electricity meter verification production lines use robotic arms to pick up electricity meters and place them onto a tray. Electrical tests are then performed by inserting a probe into the meter's input port. This technology relies heavily on the robotic arm's positioning accuracy to ensure placement accuracy, lacking a step to detect the actual placement state. Therefore, this technology has the following shortcomings: 1. Inability to accurately detect the actual port state. 2. Lack of port deformation detection capability. 3. High false detection rate. 4. Inability to effectively prevent probe damage risk; due to insufficient detection accuracy, it is impossible to accurately warn of safety risks before the probe is pressed down. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a method and terminal for monitoring pins during the production process of electricity meters, so as to accurately monitor the port status during the testing process of electricity meters.

[0004] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A method for monitoring pins during the production of an electricity meter, applied to electronic devices, the method comprising: Acquire an image of the electricity meter port and identify an ellipse in the electricity meter port image; Calculate the center of each of the ellipses and fit a line connecting all the centers; The port status judgment result is obtained based on the geometric features of the connecting lines and the geometric features of each ellipse. Execute the pin operation based on the port status determination result.

[0005] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: A pin monitoring terminal for the production process of an electricity meter includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the various steps of the pin monitoring method for the production process of an electricity meter described above.

[0006] The beneficial effects of this invention are as follows: For the acquired electricity meter port image, considering the limitations of its shooting angle, it identifies ellipses rather than circles in the electricity meter port image, thereby improving the accuracy of port recognition in the electricity meter port image. Furthermore, for the acquired ellipses, in addition to calculating the geometric features corresponding to a single ellipse, it also acquires the connecting lines of all ellipse centers, calculates the geometric features of the connecting lines, and combines the geometric features of the connecting lines with the geometric features of a single ellipse to obtain the port status judgment result. By combining the verification of the overall status of multiple ports and the verification of the status of a single port, the accuracy of the port status judgment result is ensured, thereby ensuring the accuracy of the judgment on whether the ejector pin can be properly inserted into the port, avoiding damage to the ejector pin or the electricity meter port, and enabling fully automated judgment throughout the process, improving the production efficiency and quality of the production line. Attached Figure Description

[0007] Figure 1 A flowchart illustrating the steps of a pin monitoring method during the production process of an electricity meter, as provided in this application embodiment; Figure 2 This application provides a flowchart of another step in a method for monitoring the pin during the production process of an electricity meter. Figure 3 A schematic diagram of an elliptical geometric feature provided for an embodiment of this application; Figure 4 A schematic diagram illustrating the principle of multi-dimensional diagnosis in a pin monitoring method during the production process of an electricity meter, as provided in an embodiment of this application; Figure 5 A flowchart illustrating the system response steps of a pin monitoring method during the production process of an electricity meter, as provided in this application embodiment; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0008] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.

[0009] In related technologies, because the robotic arm needs to insert the pin directly above the input port of the energy meter, the camera's shooting angle is limited, making it impossible to photograph the port from directly above. Furthermore, if the angle between the shooting angle and the plane containing the port is not 90 degrees, the originally circular energy meter input port will appear as an ellipse in the image, affecting the accuracy of the analysis. Specifically, the related technologies have the following problems: 1. Inability to accurately detect the true state of the port: Existing contour detection methods are not optimized for elliptical geometric features and cannot accurately restore the true spatial pose of the port.

[0010] 2. Lack of port deformation detection capability: Unable to detect elliptical contour deformation caused by improper placement or port damage.

[0011] 3. High false positive rate: Due to the lack of full utilization of the geometric features of the ellipse, it is easily affected by similar shapes, leading to misjudgment.

[0012] 4. Risk of ejector pin damage cannot be effectively prevented: Due to insufficient detection accuracy, it is impossible to accurately warn of safety risks before the ejector pin is pressed down.

[0013] To address the aforementioned problems, this application provides a method and terminal for monitoring the pin during the production process of an electricity meter. The following is a detailed description of the pin monitoring method for the electricity meter production process according to this application.

[0014] The pin monitoring method in this application can be used to monitor whether the alignment in the production line is accurate, such as whether the port and the pin are accurately aligned during the production of an electricity meter.

[0015] The following describes in detail a pin monitoring method in the production process of an electricity meter according to the present invention, with reference to the appendix. Figure 1 and appendix Figure 2 This includes steps 110-140.

[0016] Step 110: Acquire the energy meter port image and identify an ellipse in the energy meter port image. In the production line, the energy meter is placed in a tray. When the tray reaches the detection station, it triggers the position sensor. After the industrial camera receives the signal sent by the position sensor, it acquires the energy meter port image A.

[0017] Step 120: Calculate the center of each of the ellipses and fit a line connecting all the centers.

[0018] Step 130: Obtain the port status judgment result based on the geometric features of the connecting lines and the geometric features of each ellipse. Please refer to... Figure 3 Examples of elliptical geometric features are listed, where 'a' and '2a' are only multiples of each other, and the threshold can be adjusted accordingly.

[0019] Step 140: Perform the pin operation based on the port status judgment result.

[0020] In this way, by identifying ellipses from the acquired images of the electricity meter ports and combining the features of the port images obtained from the actual angle of the camera, the accuracy of port recognition in the electricity meter port images is improved. Furthermore, for the acquired ellipses, in addition to calculating the geometric features corresponding to a single ellipse, the geometric features of the connecting lines of all ellipse centers are also obtained and calculated. The port status judgment result is obtained by combining the geometric features of the connecting lines and the geometric features of a single ellipse. By combining the verification of the overall status of multiple ports and the verification of the status of a single port, the accuracy of the port status judgment result is ensured. This ensures the accuracy of the judgment on whether the pin can be properly inserted into the port, avoids damage to the pin or the electricity meter port, and enables fully automated judgment, improving the production efficiency and quality of the production line.

[0021] In one embodiment of this application, step 102 to step 103 are included after obtaining the electricity meter port image in step 110.

[0022] Step 102: Perform grayscale processing on the energy meter port image. Gray = 0.299R + 0.587G + 0.114B; where Gray represents the pixel value in the grayscale image of the energy meter port, 0.299, 0.587, and 0.114 are parameters in the grayscale process, which can be modified according to different needs, R represents the red pixel value of a pixel, G represents the green pixel value of a pixel, and B represents the blue pixel value of a pixel. For example, if the RGB value of a pixel is (100, 100, 100), then its corresponding pixel value after grayscale processing = 0.299 × 100 + 0.587 × 100 + 0.114 × 100 = 100; Step 103: Perform elliptical feature enhancement processing on the grayscaled energy meter port image to obtain the preprocessed energy meter port image.

[0023] The grayscale image of the electricity meter port (Gray) can be processed using an elliptic feature enhancement filter. This filter employs a convolutional kernel structure with high center weights and low edge weights, which enhances elliptical features in the image and avoids missing potential elliptical contours. The elliptic feature enhancement process can be achieved through convolution operations, as shown in the following formula: B(x,y)=ΣΣA'(x+i,y+j)×K(i,j), where i,j=-z to z; B(x,y) represents the pixel corresponding to the pixel at coordinates (x,y) in the preprocessed energy meter port image, and B represents the preprocessed energy meter port image; ΣΣA'(x+i,y+j) represents the convolution window corresponding to the pixel at coordinates (x,y) in the grayscaled energy meter port image, and K(i,j) represents the convolution kernel; |-zz|+1 represents the size of the convolution window, which is the size of the convolution kernel. For example, if the convolution kernel is 5×5, then z is 2; A' represents the grayscaled energy meter port image.

[0024] Here is an example of a convolutional kernel. Any convolutional kernel that can achieve high weights in the middle and low weights at the edges can be used. The convolutional kernel in this example is a 5×5 kernel, but other sizes of convolutional kernels can also be used.

[0025] / 16; Step 110, which involves identifying an ellipse in the energy meter port image, includes step 111: identifying an ellipse in the preprocessed energy meter port image.

[0026] In this way, the acquired electricity meter port image is first processed into grayscale and then subjected to elliptical feature enhancement processing to obtain a preprocessed electricity meter port image. Then, ellipses are identified from the preprocessed electricity meter port image. By using image preprocessing, the accuracy of subsequent ellipse identification is improved, thereby improving the accuracy of acquiring the electricity meter port.

[0027] In one embodiment of this application, step 110, which involves identifying an ellipse in the energy meter port image, includes steps 112 to 114.

[0028] Step 112: Perform binarization processing on the energy meter port image to obtain a binarized image.

[0029] Step 113: Extract the contour set of the binarized image using an edge detection algorithm.

[0030] Step 114: Fit the elliptic equation of each contour in the contour set using the elliptic curve formula.

[0031] In this way, the image of the electricity meter port is first binarized, and then the contours are extracted by the edge detection algorithm to form a contour set, which improves the accuracy of the obtained contours and avoids the interference of the background in the image of the electricity meter port. Finally, the ellipse equation corresponding to each contour in the contour set is fitted by the elliptic curve formula, and the identified contours are saved in the form of elliptic equations to facilitate the subsequent calculation of the geometric features of the ellipse.

[0032] In one embodiment of this application, step 112 includes steps 1121 to 1122.

[0033] Step 1121, T = μ_local + k × σ_local; μ_local = (sum of grayscale values ​​of all pixels within the window) / (total number of pixels within the window); σ_local = sqrt(( ) / (total number of pixels in the window)); In the formula, T represents the binarization threshold; μ_local represents the mean gray value of the window region; σ_local represents the standard deviation of the gray value of the window region; k represents the preset adjustment coefficient; sqrt() represents the square root function; and n represents the total number of pixels in the window.

[0034] Step 1122: Traverse all pixels within the window. When the target pixel is encountered, set the binarization result of the target pixel based on the comparison result between the binarization threshold and the grayscale value of the target pixel.

[0035] In this way, the energy meter port image is binarized by obtaining a local threshold. This ensures that the obtained binarization threshold can take into account the local features of the energy meter port image, thus guaranteeing the binarization effect. For binarization of the image within the window, the binarization threshold corresponding to the window is used to obtain the binarization result, which improves the accuracy of subsequent contour judgment.

[0036] In one embodiment of this application, step 114 includes step 1141: Step 1141: Apply least squares to each profile to constrain B. 2 -4AC < 0 Fits the elliptic equation Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0; In the formula, A, B, C, D, E, and F represent parameters to be determined, x represents the x-coordinate of the target point on the contour, and y represents the y-coordinate of the target point.

[0037] Specifically, the fitting process includes the following steps (1) to (4).

[0038] Step (1): For each contour, the set of contour points corresponding to the contour can be obtained. The coordinates of each contour point in the set of contour points are known.

[0039] Step (2): Calculate the sum of squared errors S for all contour points.

[0040] S= In the formula, h represents the total number of contour points in the contour point set, (x i y i ) represents the coordinates of contour point i.

[0041] Step (3): Construct the Lagrangian function L = S + λ (A 2 +B 2 +C 2 -1), where λ is the Lagrange multiplier. To minimize S, partial derivatives are taken with respect to parameters A, B, C, D, E, and F, and then set to zero to obtain estimates of these parameters. The specific method for solving the Lagrange function is already publicly available in related technologies and will not be elaborated here.

[0042] Step (4): Substitute the parameters A, B, C, D, E, and F obtained in step (3) into the discriminant Δ = B 2 -4AC is used for verification: if Δ<0, the fitting result is an ellipse, and the output parameters A, B, C, D, E and F obtained from the solution are the equations of the target ellipse corresponding to the contour; if Δ≥0, it is determined that the fitting did not obtain a valid ellipse, and the set of contour points is discarded.

[0043] Step 114 is followed by steps 115 to 116.

[0044] Step 115: Calculate the judgment geometric features of the ellipse corresponding to the contour based on the fitted target ellipse equation. The judgment geometric features include at least roundness, major axis length and perimeter.

[0045] Once the equation of the target ellipse is obtained, the coordinates of the center of the ellipse (x_i, y_i) can be calculated as ((BE - 2CD) / (4AC - B)). 2 ),(BD-2AE) / (4AC-B 2 There are multiple ways to calculate the circumference of an ellipse, and there are no restrictions here, as long as the circumference of the ellipse can be obtained; Ellipse roundness = min(a,b) / max(a,b).

[0046] The length of the major axis a and the length of the minor axis b can be calculated through eigenvalue decomposition, including the following steps (1) to (3).

[0047] Step (1): Calculate the constant term F' after translation.

[0048] F'=F+A×x_i 2 + B×x_i×y_i+ C×y_i 2 ; Step (2) Construct a quadratic matrix Q and calculate its eigenvalues.

[0049] Q= ; Eigenvalue λ1 = ½[(A+C)+ ]; Eigenvalue λ2=½[(A+C)- The eigenvalues ​​λ1 and λ2 represent the curvature of the ellipse along its principal axes.

[0050] Step (3) Calculate the length of the major axis a and the length of the minor axis b.

[0051] a= ; b= .

[0052] Step 116: Based on the judgment geometric features, select the final ellipse equation that satisfies the preset judgment conditions from all target ellipse equations corresponding to the contour set.

[0053] For example, the roundness of the ellipse needs to be greater than or equal to a roundness threshold to avoid misidentifying non-port ellipses as ports. Since ports require the insertion of a pin, their roundness will still be greater than or equal to the roundness threshold even with camera angle deviations. The ratio of the perimeter of the identified contour to the perimeter of the ellipse should be greater than an integrity threshold to avoid identifying contours that do not conform to elliptical characteristics as ports. Furthermore, the major axis length should fall within a preset length range. Since the size of the electricity meter port is fixed, even with camera angle deviations, the size of the corresponding ellipse will not deviate too much from the preset size. Therefore, a preset length range for the major axis length is set. If the major axis length does not fall within the preset length range, the corresponding ellipse is considered not to be the ellipse corresponding to the electricity meter port. Contours that do not meet any of the above conditions are discarded, and the final valid ellipse equation is obtained, which is considered to be the set of identified ports.

[0054] In this way, after fitting the target ellipse equation corresponding to each contour, the corresponding judgment geometric features are also obtained. Based on the judgment geometric features, the target ellipse equations are filtered to obtain the final ellipse equation that meets the judgment conditions. Only the contour corresponding to the final ellipse equation is considered to be the contour of the identified energy meter port. Since the identified contours may include contours corresponding to other interference items in the background in addition to the required energy meter port contours, the judgment conditions set here are used to filter all identified contours according to the judgment conditions. Only those that pass the filtering are considered to be the contours of the energy meter port, thereby further improving the accuracy of contour recognition and ensuring the accuracy of the subsequent port status judgment results.

[0055] In one embodiment of this application, step 120 includes step 121.

[0056] Step 121: Fit a line connecting all the centers using the linear equation y = kx + b; k = (mΣx_iy_i-Σx_iΣy_i) / (mΣx_i 2 -(Σx_i) 2 ); b=(Σy_i-kΣx_i) / m; In the formula, k represents the slope of the connecting line; b represents the intercept of the connecting line; x_i represents the x-axis coordinate of the center of the ellipse; y_i represents the y-axis coordinate of the center; and m represents the total number of ellipses.

[0057] In this way, it can be seen that the ports of the electricity meter are arranged in a straight line under normal circumstances. Therefore, the centers of the identified ellipses should also be arranged in a straight line. Thus, by fitting the centers of all the determined ellipses to a straight line to represent the overall state of the ports, in addition to judging the shape of each port individually, the overall state of all ports can also be judged, thereby improving the accuracy of the port state judgment results.

[0058] In one embodiment of this application, steps 210 to 220 are also included.

[0059] Step 210: Calculate the first attitude geometric features of the straight line, wherein the first attitude geometric features include at least the tilt angle.

[0060] The tilt angle θ = arctan(|k|) × 180 / π.

[0061] Step 220: Calculate the second attitude geometric features of the ellipse, wherein the second attitude geometric features include at least the ellipse tilt angle and the ellipse roundness.

[0062] Wherein, the ellipse inclination angle φ = 0.5 × arctan(B / (AC)); The area of ​​the ellipse is S = πab.

[0063] Step 130 includes steps 131 to 132.

[0064] Step 131: Obtain the overall tilt judgment result by comparing the tilt angle with the tilt threshold, obtain the individual tilt judgment result by comparing the ellipse tilt angle with the tilt threshold, and obtain the ellipse deformation judgment result by comparing the ellipse roundness.

[0065] Specifically, if the tilt angle is greater than the tilt threshold, the overall tilt judgment result is considered to be unsuccessful; if there is an ellipse with a tilt angle greater than the tilt threshold, the individual tilt judgment result is considered to be unsuccessful; if there is an ellipse with a roundness less than the ellipse roundness threshold, the ellipse deformation judgment result is considered to be unsuccessful.

[0066] Step 132: If any one of the overall tilt judgment result, the individual tilt judgment result, and the ellipse deformation judgment result fails, then the port status judgment result is failed.

[0067] In this way, when judging the port status, the second attitude geometric features of each ellipse and the first attitude geometric features of the connecting lines extracted from all ellipses are combined for judgment, so as to obtain the port status judgment result by comprehensively considering the status of each port and the overall status of all ports. Specifically, the ellipse tilt angle of a single ellipse and the tilt angle of the connecting lines are judged. Since the insertion position of the ejector pin is usually fixed, if the tilt is too large, the ejector pin cannot match the port, which will result in failure to test normally or the ejector pin being misaligned. Furthermore, for the ellipse, the ellipse deformation judgment result is also obtained based on the ellipse roundness. If the ellipse is deformed, it indicates that the port itself may have a quality problem, or the energy meter may be tilted, causing the ellipse to be deformed in the image. Both of these pose a risk that the ejector pin cannot make normal contact with the port. Therefore, as long as a failure occurs, the port status judgment result is set to fail, which ensures the normal contact between the ejector pin and the energy meter port during the energy meter production process to the greatest extent and promptly reports any possible risks.

[0068] In one embodiment of this application, step 220 further includes step 221.

[0069] Step 221, d_i=|k×x_i-y_i+b| / ; In the formula, d_i represents the distance from the center of the i-th ellipse to the connecting line; k represents the slope of the connecting line; (x_i, y_i) represents the coordinates of the center of the i-th ellipse; and b represents the intercept of the connecting line.

[0070] Step 130 further includes step 133: if the distance from the ellipse to the connecting line is greater than a distance threshold, then the distance judgment result is failed, and the port status judgment result is also failed. Therefore, step 132 can be interpreted as: if any one of the overall tilt judgment result, the individual tilt judgment result, the ellipse deformation judgment result, or the distance judgment result fails, then the port status judgment result is failed. Please refer to... Figure 4 The diagram illustrates a multi-dimensional diagnosis.

[0071] In this way, not only are the geometric features of each ellipse and the geometric features of the connecting lines obtained from all the ellipses judged, but the distance between each ellipse and the connecting line is also judged. It can be seen that if the distance from the center of the ellipse to the connecting line is too far, it indicates that the fitting of the connecting line is inaccurate or the ellipse recognition of the port is incorrect. Therefore, the port status judgment result is set to fail to avoid the problem that the pin cannot be correctly inserted into the port.

[0072] In one embodiment of this application, please refer to Figure 5 Step 140 includes steps 141 to 142.

[0073] Step 141: If the port status judgment result is passed, the pin operation process is executed normally, that is, the tray is allowed to enter the test station, and the pin is normally inserted into the port of the energy meter to realize the test process.

[0074] Step 142: If the port status judgment result is unsuccessful, stop the pin operation process and output a warning message.

[0075] The output warning information can output different levels of warning signals according to the specific diagnostic results. For example, multiple thresholds can be set, and different warning signals can be issued when each threshold is reached to indicate the severity. Alternatively, different levels of warning signals can be output based on the proportion of the threshold exceeded to indicate the severity.

[0076] In this way, the pin operation process will only be executed normally if the port status judgment result is successful. If the port status judgment result is unsuccessful, the pin operation process will not be executed, and a corresponding warning message will be output. In this way, if the pin cannot be aligned with the port of the energy meter, the pin operation process will be stopped to avoid false test results or damage to the pin. At the same time, the corresponding warning message will be output to prompt the staff to reconfirm the status of the energy meter and the pin, so as to ensure the safety of the production line during the production process.

[0077] In one embodiment of this application, historical data is stored in a database, including acquired images of the electricity meter port, the results of image qualification assessments, and the results of proper pin insertion. This allows for the adjustment of various thresholds in the judgment process based on statistical results. For example, roundness thresholds and size thresholds (range of major axis length) are determined based on the mode, normal distribution, or other statistical characteristics of historical roundness data. The tilt angle threshold is dynamically adjusted according to production line process requirements. In this application, the tilt angles of the connecting lines and the ellipse are calculated directly using the x-axis as a reference, thus simplifying the calculation process.

[0078] The following describes the application embodiments of this application. This application can apply the above solution to an automated production line for electricity meters, including the following steps 11 to 16.

[0079] Step 11: After the robotic arm places the 6 electricity meters onto the tray, the tray enters the vision inspection station.

[0080] Step 12: The system acquires images of the electricity meter port. After preprocessing the images, an ellipse fitting algorithm is used to extract the effective ellipse contour.

[0081] Step 13: Calculate ellipse parameters and perform multi-dimensional diagnosis: The inclination angle of the reference line θ = 2.1° (<2.5°), and the overall tilt diagnosis is performed; the offset distance of port 3 d3 = 2.3mm (>2.0mm), and the ellipse roundness = 0.72 (>0.70).

[0082] Step 14: The offset distance of port 3 exceeds the threshold. The system determines that there is a risk of "individual offset" and outputs a warning signal.

[0083] Step 15: The production line stops running and the ejector mechanism is locked to prevent damage to the ejector pin.

[0084] Step 16: After the maintenance personnel adjust the position of the abnormal energy meter, the system retests and passes the test.

[0085] Please refer to Figure 6 The present invention also provides a pin monitoring terminal 300 in the production process of an electricity meter, including a memory 301, a processor 302, and a computer program stored in the memory 301 and running on the processor 302. When the processor 302 executes the computer program, it implements the various steps in the pin monitoring method in the production process of an electricity meter as described above.

[0086] The beneficial effects of the electronic device of the present invention are the same as those of the method described above, and will not be repeated here.

[0087] In summary, this application provides a method and terminal for monitoring the pin during the production process of an electricity meter. By accurately analyzing the elliptical geometric features of the electricity meter's input port, a multi-dimensional diagnostic model is established to achieve precise early warning of safety risks before the pin is pressed down. First, image preprocessing and binarization provide a basis for increasing the recognizability of the elliptical contour. Furthermore, based on the formula for elliptical curves, elliptical curve fitting is performed on the contour to obtain the corresponding geometric parameters of the elliptical curve through geometric calculations, facilitating subsequent judgment processes.

[0088] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for monitoring pins during the production process of an electricity meter, characterized in that, include: Acquire an image of the electricity meter port and identify an ellipse in the electricity meter port image; Calculate the center of each of the ellipses and fit a line connecting all the centers; The port status judgment result is obtained based on the geometric features of the connecting lines and the geometric features of each ellipse. Execute the pin operation based on the port status determination result.

2. The method for monitoring the pin during the production process of an electricity meter according to claim 1, characterized in that, After acquiring the energy meter port image, the following steps are included: The image of the electricity meter port is converted to grayscale. The grayscale image of the electricity meter port is subjected to elliptic feature enhancement processing to obtain the preprocessed electricity meter port image. The step of identifying the ellipse in the energy meter port image includes: Ellipses are identified in the preprocessed image of the electricity meter port.

3. A method for monitoring the pin during the production process of an electricity meter according to claim 1 or 2, characterized in that, The step of identifying the ellipse in the energy meter port image includes: The energy meter port image is binarized to obtain a binarized image; An edge detection algorithm is used to extract the contour set of the binarized image; The elliptic equation of each contour in the contour set is fitted using the elliptic curve formula.

4. The method for monitoring the pin during the production process of an electricity meter according to claim 3, characterized in that, The process of binarizing the energy meter port image to obtain a binarized image includes: T = μ_local + k × σ_local; μ_local = (sum of grayscale values ​​of all pixels within the window) / (total number of pixels within the window); σ_local = sqrt(( ) / (total number of pixels in the window)); In the formula, T represents the binarization threshold; μ_local represents the mean gray value of the window region; σ_local represents the standard deviation of the gray value of the window region; k represents the preset adjustment coefficient; sqrt() represents the square root function; and n represents the total number of pixels in the window. Traverse all pixels within the window. When a target pixel is encountered, set the binarization result of the target pixel based on the comparison result between the binarization threshold and the grayscale value of the target pixel.

5. The method for monitoring the pin during the production process of an electricity meter according to claim 3, characterized in that, The fitting of the elliptic equation for each contour in the contour set using the elliptic curve formula includes: For each contour, use the least squares method to constrain B. 2 -4AC < 0 Fits the elliptic equation Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0; In the formula, A, B, C, D, E, and F represent parameters to be determined, x represents the x-coordinate of the target point on the contour, and y represents the y-coordinate of the target point; After fitting the elliptic equation of each contour in the contour set using the elliptic curve formula, the method further includes: The geometric features of the ellipse corresponding to the contour are calculated based on the fitted target ellipse equation. The geometric features include at least roundness, major axis length, and perimeter. Based on the judgment geometric features, the final ellipse equation that meets the preset judgment conditions is selected from all target ellipse equations corresponding to the contour set.

6. The method for monitoring the pin during the production process of an electricity meter according to claim 1, characterized in that, The calculation of the center of each of the ellipses and the fitting of a line connecting all the centers includes: Fit a line connecting all the stated centers with the equation y = kx + b. k = (mΣx_iy_i-Σx_iΣy_i) / (mΣx_i 2 -(Σx_i) 2 ); b=(Σy_i-kΣx_i) / m; In the formula, k represents the slope of the connecting line; b represents the intercept of the connecting line; x_i represents the x-axis coordinate of the center of the ellipse; y_i represents the y-axis coordinate of the center; and m represents the total number of ellipses.

7. The method for monitoring the pin during the production process of an electricity meter according to claim 1, characterized in that, Also includes: Calculate the first attitude geometric features of the straight line, wherein the first attitude geometric features include at least a tilt angle; Calculate the second attitude geometric features of the ellipse, which include at least the ellipse tilt angle and the ellipse roundness; The process of obtaining the port status determination result based on the geometric features of the connecting lines and the geometric features of each ellipse includes: The overall tilt judgment result is obtained by comparing the tilt angle with the tilt threshold, the individual tilt judgment result is obtained by comparing the ellipse tilt angle with the tilt threshold, and the ellipse deformation judgment result is obtained by comparing the ellipse roundness. If any one of the overall tilt judgment result, the individual tilt judgment result, or the ellipse deformation judgment result fails, then the port status judgment result is failed.

8. The method for monitoring the pin during the production process of an electricity meter according to claim 7, characterized in that, The calculation of the second attitude geometric features of the ellipse also includes: d_i=|k×x_i-y_i+b| / ; In the formula, d_i represents the distance from the center of the i-th ellipse to the connecting line; k represents the slope of the connecting line; (x_i, y_i) represents the coordinates of the center of the i-th ellipse; and b represents the intercept of the connecting line. The process of obtaining the port status determination result based on the geometric features of the connecting lines and the geometric features of each ellipse includes: If the distance from the ellipse to the connecting line is greater than the distance threshold, the port status judgment result is "fail".

9. A method for monitoring the pin during the production process of an electricity meter according to claim 1 or 7, characterized in that, The step of performing the pin operation based on the port status determination result includes: If the port status judgment result is pass, the pin operation process is executed normally; If the port status judgment result is unsuccessful, the pin operation process will be stopped and a warning message will be output.

10. A pin monitoring terminal for the production process of an electricity meter, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement each step of the pin monitoring method in the production process of an electricity meter as described in any one of claims 1 to 9.