A relay contact scanning range measurement method based on image feature recognition
Through image feature recognition technology, accurate measurement of the relay contact sweep process is solved, and the problem of inaccurate measurement in the existing technology is improved, and the reliability and detection accuracy of the relay are improved.
Patent Information
- Application Number
- CN202310632311.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2043-05-31
AI Technical Summary
The prior art cannot accurately measure the sweep of the relay contacts, resulting in unstable operation of the relay under high-frequency switches and high current loads, affecting its life and reliability.
Using an image feature recognition method, images during the relay motion cycle are collected, pre-processing, fuzzy area recognition, adaptive edge detection and template matching are performed, coordinate information of dynamic and static contact contact points is calculated, and the contact sweep is obtained.
It realizes accurate and rapid measurement of the relay contact sweep process, and improves the reliability and manufacturing inspection level of the relay.
Smart Images

Figure CN116907352B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of relay parameter measurement, and in particular to a relay contact sweep range measurement method based on image feature recognition. Background Art
[0002] Relay contact movement is divided into an engagement phase and a release phase. During the engagement phase, when the relay is energized, the electromagnetic force of the middle contact bracket drives the middle contact upward, bringing it into contact with the upper contact, thus connecting the middle-upper circuit. Conversely, when the relay is de-energized, the armature's weight forces the bracket downward, bringing it into contact with the lower contact, thus connecting the middle-lower circuit. This is the release phase. To ensure reliable electrical contact between the contacts, a certain sweep distance, or shared travel, between the middle contact and the upper or lower contact is required during contact movement.
[0003] Contact sweep distance is a critical mechanical parameter of a relay. It removes dust and oxides from the contact surfaces, ensuring excellent contact between the contacts and stable electrical signal transmission. Insufficient or absent contact sweep distance can easily lead to poor contact, increased contact resistance, signal interference, and other issues, seriously impacting the relay's operating efficiency and reliability. Furthermore, friction and wear caused by the contact sweep distance can lead to loss of contact energy and contact material, shortening the relay's service life. Especially under high-frequency switching and high-current loads, the contact sweep distance directly affects the relay's lifespan and reliability. Excessive contact sweep distance can easily lead to contact failure and welding problems. Excessive contact sweep distance can easily cause problems such as coking, arcing, and discharge, further impacting the relay's service life and operational stability. However, friction and wear caused by the relative displacement of the contact sweep distance can also lead to loss of contact energy and contact material.
[0004] Therefore, contact sweep distance is not only a criterion for evaluating contact performance, which affects relay reliability, but also a crucial indicator for analyzing contact surface roughness and degradation, impacting relay service life. Currently, there is no practical method for measuring relay contact sweep distance. The only way to calculate relay contact sweep distance is through theoretical calculation or multi-dimensional simulation. These theoretical measurement results are not only inefficient but also suffer from large deviations and are inaccurate. Summary of the Invention
[0005] The present invention aims to solve at least one of the technical problems existing in the related art. To this end, the present invention provides a relay contact sweep range measurement method based on image feature recognition.
[0006] The present invention provides a relay contact sweep range measurement method based on image feature recognition, comprising:
[0007] S100: collecting motion images within a motion cycle of the relay to be tested and pre-processing the motion images;
[0008] S200: reducing the resolution of the pre-processed motion image, searching for a fuzzy area including the positions of the moving contact and the stationary contact, and increasing the resolution of the motion image in the fuzzy area to determine an area of interest including the positions of the moving contact and the stationary contact;
[0009] S300: identifying the moving contact of the relay to be tested within the region of interest using an adaptive edge detection algorithm combined with a minimum circumscribed circle method on the pre-processed motion image;
[0010] S400: rotating the introduced template image, matching the best template image that matches the image of the static contact angle change, and identifying the static contact of the relay to be tested through the best template image;
[0011] S500: Tracking the moving contact and the static contact within the region of interest of the motion image to be measured, and obtaining first coordinate information of contact points between the moving and static contacts;
[0012] S600: Calculate and obtain the contact sweep distance of the relay to be tested based on the first coordinate information of the plurality of motion images to be tested.
[0013] According to a relay contact sweep range measurement method based on image feature recognition provided by the present invention, step S400 includes:
[0014] S410: introducing a template image, rotating the template image, and obtaining a template transformed image;
[0015] S420: Acquire a static contact transformation image of a static contact angle change;
[0016] S430: Calculating similarities between the template transformation images at different angles and the static touch transformation images at different angles, and determining the optimal template image.
[0017] According to a relay contact sweep range measurement method based on image feature recognition provided by the present invention, the preprocessing of the motion image in step S100 includes grayscale processing, binarization processing and denoising processing.
[0018] According to a relay contact sweep range measurement method based on image feature recognition provided by the present invention, the binarization processing step includes:
[0019] S111: Acquire a pixel histogram of the motion image according to the motion image;
[0020] S112: Adaptively determining a binarization threshold of the image according to the pixel histogram;
[0021] S113: setting the pixel points in the pixel histogram whose values are smaller than the binarization threshold to white, and setting the pixel points in the pixel histogram whose values are larger than the binarization threshold to black, to obtain a binarized motion image.
[0022] According to a relay contact sweep range measurement method based on image feature recognition provided by the present invention, step S300 further includes:
[0023] S311: performing edge detection within the region of interest using an adaptive edge detection algorithm to obtain discrete edge points;
[0024] S312: Perform straight line fitting on the discrete edge points using the least squares method.
[0025] According to a relay contact sweep distance measurement method based on image feature recognition provided by the present invention, the mathematical model of the least squares method in step S312 is expressed as:
[0026]
[0027] in, For the The horizontal coordinates of discrete edge points, For the The vertical coordinates of discrete edge points, is the first parameter of the fitted line, is the second parameter of the fitted line, is the number of discrete edge points.
[0028] According to a relay contact sweep distance measurement method based on image feature recognition provided by the present invention, the contact sweep distance calculation formula of the relay to be measured in step S600 is:
[0029]
[0030] in, is the contact sweep range of the relay to be tested, The distance that the moving and static contacts sweep to the left. The distance swept to the right by the contact point of the moving and static contacts;
[0031]
[0032] in, is the initial coordinate of the moving contact center, is the coordinate of the center of the moving contact when sweeping to the left, is the initial static contact angle, is the static contact angle when sweeping to the left, is the radius of the moving contact;
[0033]
[0034] in, is the coordinate of the center of the moving contact when sweeping to the right, It is the static contact angle when sweeping to the right.
[0035] The present invention provides a relay contact sweep measurement method based on image feature recognition. The method collects images within a complete relay action cycle through a relay experimental platform based on machine vision technology, and uses a multi-angle contact feature recognition algorithm to identify and track the dynamic and static contacts of the relay, thereby obtaining the changes in the kinematic parameters of the contacts. Based on the research on the kinematic parameters of the relay contacts and the mechanical parameters of the relay, the method accurately and quickly measures the contact sweep parameters that cannot be measured by current manual measurement methods, thereby improving the reliability of relay products and the industry's manufacturing and inspection level.
[0036] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 The present invention provides a relay contact scanning range measurement method based on image feature recognition. DETAILED DESCRIPTION
[0039] To make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the present invention. Obviously, the embodiments described are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.
[0040] In the description of the embodiments of the present invention, it should be noted that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing the embodiments of the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore should not be understood as limiting the embodiments of the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance.
[0041] In the description of the embodiments of the present invention, it should be noted that, unless otherwise specified or limited, the terms "connected" and "connection" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; mechanical connections, electrical connections; and direct connections or indirect connections through an intermediary. Those skilled in the art will understand the specific meanings of the above terms in the embodiments of the present invention based on the specific circumstances.
[0042] In the embodiments of the present invention, unless otherwise expressly specified or limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or that the first and second features are in indirect contact through an intermediate medium. Furthermore, a first feature being "above," "above," or "above" a second feature may mean that the first feature is directly above or diagonally above the second feature, or simply means that the first feature is at a higher level than the second feature. A first feature being "below," "below," or "below" a second feature may mean that the first feature is directly below or diagonally below the second feature, or simply means that the first feature is at a lower level than the second feature.
[0043] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0044] The following combination Figure 1 Describe the embodiments provided by the present invention.
[0045] The present invention provides a relay contact sweep range measurement method based on image feature recognition, comprising:
[0046] S100: collecting motion images within a motion cycle of the relay to be tested and pre-processing the motion images;
[0047] The pre-processing of the motion image in step S100 includes grayscale processing, binarization processing and denoising processing.
[0048] The binarization step includes:
[0049] S111: Acquire a pixel histogram of the motion image according to the motion image;
[0050] S112: Adaptively determining a binarization threshold of the image according to the pixel histogram;
[0051] S113: setting the pixel points in the pixel histogram whose values are smaller than the binarization threshold to white, and setting the pixel points in the pixel histogram whose values are larger than the binarization threshold to black, to obtain a binarized motion image.
[0052] In some embodiments, the relay to be tested is first fixed on the base of the relay shooting platform, and the on and off of the relay and the high-speed camera are controlled by a synchronous trigger for shooting. Secondly, the high-speed camera is adjusted to a suitable position to ensure that all contacts of the relay can be fully photographed. A ring light source is placed in front of the lens, and the light source is turned on to ensure that the camera can shoot clearly; the camera shooting frequency is adjusted to 2000 frames / second, and the on and off of the relay and the high-speed camera are controlled by a synchronous trigger for shooting. After the image acquisition is completed, the acquired image is transmitted to the computer through the CCD image sensor for the next step of processing.
[0053] In some embodiments, preprocessing includes grayscale processing, binarization processing, and denoising of the image. The grayscale processing is used to convert the color image captured by the high-speed camera into a grayscale image. The red, green, and blue components of each pixel in the color image are weighted averaged according to a certain ratio to obtain a single grayscale value instead of the original three components, thereby graying the image. For a three-channel pixel, its grayscale value can be calculated based on a certain weighting coefficient. The grayscale value is 0.299×R+0.587×G+0.114×B, where R, G, and B represent the red, green, and blue components of the pixel, respectively. 0.299, 0.587, and 0.114 are weighting coefficients determined through experiments. Their sum is 1, ensuring that the grayscale value ranges from 0 to 255. The role of binarization is to adaptively determine the binarization threshold of the image based on the pixel histogram of the image, and set the pixels in the image that are smaller than the threshold to 0, that is, white, and the pixels that are larger than the threshold to 255, that is, black. By traversing the entire image, a binary image is obtained, which makes the black and white contrast more obvious, improves the clarity and readability of the image, and increases the subsequent processing speed. Denoising is to remove noise in the image through filtering and noise reduction algorithms, making the image clearer and the details more obvious, thereby improving the accuracy and reliability of the image.
[0054] S200: reducing the resolution of the pre-processed motion image, searching for a fuzzy area including the positions of the moving contact and the stationary contact, and increasing the resolution of the motion image in the fuzzy area to determine an area of interest at the positions of the moving contact and the stationary contact;
[0055] In some embodiments, the method in step S200 is a regional prediction acceleration algorithm. Using a coarse-to-fine search strategy, the image resolution is reduced, a rough location is determined in the low-resolution image, and then the precise location is determined in the high-resolution image. The matching region is then reduced in size. Based on the kinematic characteristics of relays and observations of the actual motion of multiple relays, it was found that the motion region of the moving and static contacts during relay operation is relatively fixed. Therefore, matching relay contacts does not require a full search across the entire region; instead, matching can be performed within the region of interest.
[0056] Furthermore, this matching region prediction algorithm is applied to the relay contact matching process. The principle of this algorithm is to calculate the magnitude and direction of the contact velocity based on the position information of the contact in the previous two frames of the image. This velocity is used to calculate the area in the image at the current moment where the contact is likely to appear. Subsequent operations are performed within this area. Taking two consecutive frames from a set of sequential images and overlapping them, the distance and average velocity of the moving contact during this period can be calculated. The calculation formula is as follows:
[0057]
[0058] in, is the displacement distance of the moving contact within the sampling interval of the two selected frames of images, is the average speed of the moving contact during the sampling interval of the two selected frames of images, is the sampling frequency of the two selected frames of images, is the coordinate of the moving contact of the first frame image obtained by sampling, The coordinates of the moving contact in the second frame of image obtained by sampling.
[0059] Furthermore, a matching area slightly larger than the template image is determined based on the value calculated by the above formula, and the center of the moving contact in the next frame is within this area, that is, this area is the area where the target image will appear in the future, that is, the area of interest. The search for the target image of the next frame only needs to be performed within this area of interest.
[0060] S300: identifying the moving contact of the relay to be tested within the region of interest using an adaptive edge detection algorithm combined with a minimum circumscribed circle method on the pre-processed motion image;
[0061] Wherein, step S300 further includes:
[0062] S311: performing edge detection within the region of interest using an adaptive edge detection algorithm to obtain discrete edge points;
[0063] S312: Perform straight line fitting on the discrete edge points using the least squares method.
[0064] The mathematical model of the least squares method in step S312 is expressed as:
[0065]
[0066] in, For the The coordinates of discrete edge points, is the first parameter of the fitted line, is the second parameter of the fitted line, is the number of discrete edge points.
[0067] S400: rotating the introduced template image, matching the best template image that matches the image of the static contact angle change, and identifying the static contact of the relay to be tested through the best template image;
[0068] Wherein, step S400 includes:
[0069] S410: introducing a template image, rotating the template image, and obtaining a template transformed image;
[0070] S420: Acquire a static contact transformation image of a static contact angle change;
[0071] S430: Calculating similarities between the template transformation images at different angles and the static touch transformation images at different angles, and determining the optimal template image.
[0072] Furthermore, template matching is a method of finding the most matching or similar part of an image to another template image. By traversing, the target to be found can be found in the image based on the template image and its coordinate position can be determined.
[0073] In some embodiments, if the image is rotated around its center, the original coordinate system needs to be translated to the center of the image first, and then rotated around the origin according to the above formula. Finally, the rotated image only needs to be translated back to the coordinate origin. The transformation matrix after rotation is:
[0074]
[0075]
[0076]
[0077]
[0078] in, are the coordinates of the center point around which the image is rotated, is the image rotation angle, is the transformation matrix of the image from the origin to the center point, is the change matrix of the image after it is translated to the center point and rotated around the center point, The transformation matrix of the image after it is rotated around the center point and translated to the origin.
[0079] S500: Tracking the moving contact and the static contact within the region of interest of the motion image to be measured, and obtaining first coordinate information of contact points between the moving and static contacts;
[0080] S600: Calculate and obtain the contact sweep distance of the relay to be tested based on the first coordinate information of the plurality of motion images to be tested.
[0081] The calculation formula for the contact sweep distance of the relay to be tested in step S600 is:
[0082]
[0083] in, is the contact sweep range of the relay to be tested, The distance that the moving and static contacts sweep to the left. The distance swept to the right by the contact point of the moving and static contacts;
[0084]
[0085] in, is the initial coordinate of the moving contact center, is the coordinate of the center of the moving contact when sweeping to the left, is the initial static contact angle, is the static contact angle when sweeping to the left, is the radius of the moving contact;
[0086]
[0087] in, is the coordinate of the center of the moving contact when sweeping to the right, It is the static contact angle when sweeping to the right.
[0088] The present invention provides a relay contact sweep range measurement method based on image feature recognition. The method preprocesses the collected motion image of the relay to be tested within one cycle, makes the image clearer, highlights the details, improves the accuracy and reliability of the image, determines the optimal template image through a template matching algorithm, and reduces the recognition area in the image processing process through a matching area prediction acceleration algorithm, thereby improving efficiency. Overall, a relay experimental platform based on machine vision technology is used to collect images within a complete action cycle of the relay, and a multi-angle contact feature recognition algorithm is used to identify and track the dynamic and static contacts of the relay, thereby obtaining a kinematic parameter change curve of the contact. According to the research on the kinematic parameters of the relay contact and the mechanical parameters of the relay, machine vision technology is used to realize non-contact measurement of the relay contact sweep range.
[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A relay contact sweep range measurement method based on image feature recognition, characterized in that: include: S100: collecting motion images within a motion cycle of the relay to be tested and pre-processing the motion images; S200: reducing the resolution of the pre-processed motion image, searching for a fuzzy area of the positions of the moving contact and the stationary contact, increasing the resolution of the motion image of the fuzzy area, and determining a region of interest of the positions of the moving contact and the stationary contact; S300: identifying the moving contact of the relay to be tested within the region of interest using an adaptive edge detection algorithm combined with a minimum circumscribed circle method on the pre-processed motion image; S400: rotating the introduced template image, matching the best template image that matches the image of the static contact angle change, and identifying the static contact of the relay to be tested through the best template image; S500: Tracking the moving contact and the static contact within the region of interest of the motion image to be measured, and obtaining first coordinate information of contact points between the moving and static contacts; S600: Calculate and obtain the contact sweep distance of the relay to be tested based on the first coordinate information of the plurality of motion images to be tested.
2. The relay contact sweep range measurement method based on image feature recognition according to claim 1, characterized in that: Step S400 includes: S410: introducing a template image, rotating the template image, and obtaining a template transformed image; S420: Acquire a static contact transformation image of a static contact angle change; S430: Calculating similarities between the template transformation images at different angles and the static touch transformation images at different angles, and determining the optimal template image.
3. The relay contact sweep range measurement method based on image feature recognition according to claim 1, characterized in that: The motion image preprocessing in step S100 includes grayscale processing, binarization processing and denoising processing.
4. The relay contact sweep range measurement method based on image feature recognition according to claim 3, characterized in that: The binarization step includes: S111: Acquire a pixel histogram of the motion image according to the motion image; S112: Adaptively determining a binarization threshold of the image according to the pixel histogram; S113: setting the pixel points in the pixel histogram whose values are smaller than the binarization threshold value to white, and setting the pixel points in the pixel histogram whose values are larger than the binarization threshold value to black, to obtain a binarized motion image.
5. The relay contact sweep range measurement method based on image feature recognition according to claim 1, characterized in that: Step S300 also includes: S311: performing edge detection within the region of interest using an adaptive edge detection algorithm to obtain discrete edge points; S312: Perform straight line fitting on the discrete edge points using the least squares method.
6. The relay contact sweep distance measurement method based on image feature recognition according to claim 5, characterized in that: The mathematical model of the least square method in step S312 is expressed as: in, For the The horizontal coordinates of discrete edge points, For the The ordinate of each discrete edge point, is the first parameter of the fitted line, is the second parameter of the fitted line, is the number of discrete edge points.
7. The relay contact sweep range measurement method based on image feature recognition according to claim 1, characterized in that: The calculation formula for the contact sweep range of the relay to be tested in step S600 is: in, is the contact sweep range of the relay to be tested, The distance that the moving and static contacts sweep to the left. The distance swept to the right by the contact point of the moving and static contacts; in, is the initial coordinate of the moving contact center, is the coordinate of the center of the moving contact when sweeping to the left, is the initial static contact angle, is the static contact angle when sweeping to the left, is the radius of the moving contact; in, is the coordinate of the center of the moving contact when sweeping to the right, It is the static contact angle when sweeping to the right.
Citation Information
Patent Citations
Relay contact overtravel measurement method based on target point feature capture and tracking
CN114485439A
Relay switching time measuring method based on image feature recognition tracking technology
CN114487808A