A method and system for detecting the pole designation of a magnet
By using polar coordinate grid mapping and proportional transformation, the problem of misjudgment of magnetic pole markings caused by size differences in the detection of circular magnets was solved, and high-precision magnetic pole marking detection was achieved.
Patent Information
- Application Number
- CN202611122392.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-28
- Publication Date
- 2026-08-25
AI Technical Summary
The error rate of magnetic pole marking deviation due to size differences is high during the inspection of circular magnets, and existing machine vision inspection methods are difficult to effectively reduce this.
The method of polar coordinate grid mapping and proportional transformation is adopted. A polar coordinate grid is established by obtaining sample points of standard magnet images and mapping it onto the image of the magnet to be tested. This compensates for the radial size scaling of magnets from different batches, eliminates circumferential rotation interference, and judges whether the magnets are qualified based only on the angle and radial offset of the magnetic pole markings.
It effectively reduces the misjudgment of magnetic pole marking deviation caused by differences in magnet size, improves the robustness and accuracy of detection, and adapts to the size fluctuations of magnets in different batches.
Smart Images

Figure CN122636615A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and specifically to a method and system for detecting the magnetic pole markings of a magnet. Background Technology
[0002] Magnetic pole markings (such as N / S markings) ensure the correct use of magnets. However, on automated production lines, it is difficult to guarantee that the angle of a round magnet remains consistent during each inspection, which complicates the detection of the magnetic pole marking positions.
[0003] Currently, machine vision is commonly used to improve the efficiency of detecting magnetic pole markings on circular magnets. Existing common machine vision detection methods include fixed template or fixed feature point matching. This involves pre-marking reference positions for the magnetic pole markings on a standard image, then translating and rotating the image to be detected, and comparing the deviation between the actual positions of the magnetic pole markings and the reference positions.
[0004] However, in practical applications, not only does the circular magnet rotate circumferentially during transport with an uncontrollable angle of rotation, but the size of magnets from different batches also varies. Matching based on a fixed template or fixed feature points can easily misjudge the differences in magnet size as deviations in the position of the magnetic pole markings, leading to an increased detection misjudgment rate. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for detecting the magnetic pole markings of a magnet. The technical problem to be solved is how to reduce the misjudgment of magnetic pole markings caused by size differences during the detection process of circular magnets.
[0006] This invention is achieved through the following technical solution:
[0007] A method for detecting the magnetic pole markings of a magnet, comprising the following steps:
[0008] Obtain a standard magnet image and extract sample points from the standard magnet image; establish a polar coordinate grid based on the sample points of the standard magnet image; wherein, the polar coordinate grid is used to draw concentric circles through the sample points;
[0009] Acquire an image of the magnet to be detected, and extract feature points corresponding to the sample points from the image of the magnet to be detected;
[0010] The above polar coordinate grid is mapped onto the image of the magnet to be detected, and the above polar coordinate grid is transformed proportionally. It is then determined whether each concentric circle of the transformed polar coordinate grid coincides with the corresponding feature point on the image of the magnet to be detected.
[0011] If yes, then the above magnetic pole markings are qualified; otherwise, the above magnetic pole markings are unqualified.
[0012] The aforementioned proportional transformation of the polar coordinate grid directly compensates for the radial dimension scaling of different batches of magnets. When the overall size of the magnet increases or decreases, the concentric circle pole diameters of the polar coordinate grid are scaled proportionally, but the angle and relative radius ratio of the magnetic pole markings in the polar coordinate grid remain unchanged, ensuring that changes in magnet size will not trigger a "non-conforming" alarm. Only the angle / radial offset of the magnetic pole markings themselves will trigger a "non-conforming" alarm.
[0013] When the polar coordinate grid is mapped onto the image of the magnet to be detected, it can be aligned by rotation. The purpose is to rotate the concentric circles to the position that coincides with the feature points, so that the detection focuses on the polar radius and polar angle deviation of the magnetic pole markings relative to the center of the circle, rather than the absolute pixel coordinates, thus eliminating the interference of circumferential rotation during magnet transport on the detection of magnetic pole markings.
[0014] Furthermore, a polar coordinate grid is established based on the sample points of the aforementioned standard magnet image, including the following steps:
[0015] The standard magnet is extracted from the above standard magnet image to obtain a first standard image; the edge points of the standard magnet are extracted from the first standard image to obtain a first sample point set; the midpoint of the standard magnet is determined based on the first sample point set to obtain a second sample point.
[0016] Magnetic pole markings are extracted from the above standard magnet images to obtain a second standard image; multiple magnetic pole marking endpoints are extracted from the above second standard image to obtain a third sample point set;
[0017] The midpoint between the endpoints of adjacent magnetic pole labels is extracted from the second standard image above to obtain the fourth sample point set;
[0018] By superimposing the first and second standard images, a third standard image is obtained; a polar coordinate system is established on the third standard image with the second sample point as the pole, and the first, second, third, and fourth sample point sets are mapped to the polar coordinate system.
[0019] Draw concentric circles on the mapped polar coordinate system, passing through the first set of sample points, the third set of sample points, and the fourth set of sample points; the center of the concentric circles coincides with the pole.
[0020] By extracting a polar coordinate window within the concentric circle of the first set of sample points, a polar coordinate grid is obtained.
[0021] The outer contour of the standard magnet is determined by the edge points of the standard magnet, the boundary of the magnetic pole mark is determined by the endpoints of the magnetic pole mark, and whether the magnetic pole mark is deformed is determined by the midpoint between the endpoints of adjacent magnetic pole marks. The midpoint between the endpoints of adjacent magnetic pole marks reduces the extraction of sample points and ensures the detection of deformation of the magnetic pole mark, thereby improving the detection efficiency.
[0022] The endpoints of the aforementioned magnetic pole labels and the midpoints between adjacent magnetic pole label endpoints are mapped onto the same polar coordinate grid. When the aforementioned polar coordinate grid is transformed proportionally, the outer concentric circle (i.e., the concentric circle through the first sample point set) and the inner concentric circle (i.e., the concentric circle through the third and fourth sample point sets) are scaled synchronously, thus resolving the possibility of misjudging normal magnetic pole labels on large magnets as magnetic pole label offsets.
[0023] Furthermore, mapping the aforementioned polar coordinate grid onto the image of the magnet to be detected includes the following steps:
[0024] Extract the edge points of the magnet to be detected from the above image of the magnet to be detected, and take any edge point as a grid point;
[0025] The aforementioned polar coordinate grid coincides with the grid's fixed point via the concentric circles of the first sample point set;
[0026] Rotate the polar coordinate grid until only the grid points on the edge of the magnet to be detected coincide.
[0027] First, rotate the above polar coordinate grid to prepare for the concentric circles of the outer contour to coincide with the edge points of the magnet to be detected. At this time, there may be a situation where the concentric circles of the outer contour completely coincide with the edge points of the magnet to be detected. In this case, the polar coordinate grid is not transformed proportionally, and it is directly determined whether each concentric circle of the above polar coordinate grid coincides with the corresponding feature point on the image of the magnet to be detected.
[0028] Furthermore, the polar coordinate grid is proportionally transformed until the polar coordinate grid coincides with multiple edge points of the magnet to be detected through the concentric circles of the first sample point set.
[0029] Using multiple edge points of the magnet under test for overlap verification, rather than a single point, enhances robustness to size scaling. During magnet manufacturing, individual edge points may not necessarily coincide.
[0030] By proportionally transforming the above polar coordinate grid, the deviation caused by the difference in magnet size is compensated. After the transformation, the above polar coordinate grid can truly reflect the relative position of the magnetic pole markings under the standard size, eliminating the misjudgment of magnetic pole marking deviation caused by the difference in magnet size.
[0031] Furthermore, determining the midpoint of the standard magnet based on the aforementioned first sample point set includes the following steps:
[0032] A first reference line and a second reference line are projected onto the first standard image, and the first reference line and the second reference line intersect with the two edge points of the standard magnet, respectively.
[0033] Move the first reference line until the two edge points of the standard magnet intersect at the first reference line at the maximum distance; and move the second reference line until the two edge points of the standard magnet intersect at the second reference line at the maximum distance.
[0034] Obtain the intersection of the first and second baselines when the movement stops. This intersection is the midpoint of the standard magnet.
[0035] For a circular magnet, the center is determined by finding the intersection of the longest chords.
[0036] The second aspect provides a magnetic pole marking detection system for a magnet, wherein the magnetic pole marking detection system employs any of the above-mentioned magnetic pole marking detection methods;
[0037] The magnetic pole marking detection system includes:
[0038] Image acquisition module, the above image acquisition module is used to acquire standard magnet images and magnet images to be detected;
[0039] An extraction module is connected to an image acquisition module; the extraction module is used to extract sample points from a standard magnet image and to extract feature points corresponding to the sample points from the magnet image to be detected.
[0040] A grid creation module is connected to the extraction module; the grid creation module establishes a polar coordinate grid based on sample points of the standard magnet image; wherein, the polar coordinate grid is used to draw concentric circles through the sample points;
[0041] The detection module, which connects to the mesh creation module and the extraction module, is used to perform the following steps:
[0042] The above polar coordinate grid is mapped onto the image of the magnet to be detected, and the above polar coordinate grid is transformed proportionally. It is then determined whether each concentric circle of the transformed polar coordinate grid coincides with the corresponding feature point on the image of the magnet to be detected.
[0043] If yes, then the above magnetic pole markings are qualified; otherwise, the above magnetic pole markings are unqualified.
[0044] By using polar coordinate grid mapping and proportional transformation, the polar coordinate grid can be dynamically adjusted adaptively according to the actual size of the magnet under test during each inspection. The relative proportion is used as the judgment criterion, rather than using a preset fixed pixel distance as the pass standard. This helps to reduce false alarms caused by batch size fluctuations of magnets on industrial production lines.
[0045] Furthermore, the steps for establishing a polar coordinate mesh using the aforementioned mesh creation module include:
[0046] The extraction module described above performs the following steps:
[0047] The standard magnet is extracted from the above standard magnet image to obtain a first standard image; the edge points of the standard magnet are extracted from the first standard image to obtain a first sample point set; the midpoint of the standard magnet is determined based on the first sample point set to obtain a second sample point.
[0048] Magnetic pole markings are extracted from the above standard magnet images to obtain a second standard image; multiple magnetic pole marking endpoints are extracted from the above second standard image to obtain a third sample point set;
[0049] The midpoint between the endpoints of adjacent magnetic pole labels is extracted from the second standard image above to obtain the fourth sample point set;
[0050] The above-mentioned mesh creation module performs the following steps:
[0051] By superimposing the first and second standard images, a third standard image is obtained; a polar coordinate system is established on the third standard image with the second sample point as the pole, and the first, second, third, and fourth sample point sets are mapped to the polar coordinate system.
[0052] Draw concentric circles on the mapped polar coordinate system, passing through the first set of sample points, the third set of sample points, and the fourth set of sample points; the center of the concentric circles coincides with the pole.
[0053] By extracting a polar coordinate window within the concentric circle of the first set of sample points, a polar coordinate grid is obtained.
[0054] Furthermore, the aforementioned detection module is used to map a polar coordinate grid onto the image of the magnet to be detected, including the following steps:
[0055] Extract the edge points of the magnet to be detected from the above image of the magnet to be detected, and take any edge point as a grid point;
[0056] The aforementioned polar coordinate grid coincides with the grid's fixed point via the concentric circles of the first sample point set;
[0057] Rotate the polar coordinate grid until only the grid points on the edge of the magnet to be detected coincide.
[0058] Furthermore, the extraction module above determines the midpoint of the standard magnet based on the first sample point set, including the following steps:
[0059] A first reference line and a second reference line are projected onto the first standard image, and the first reference line and the second reference line intersect with the two edge points of the standard magnet, respectively.
[0060] Move the first reference line until the two edge points of the standard magnet intersect at the first reference line at the maximum distance; and move the second reference line until the two edge points of the standard magnet intersect at the second reference line at the maximum distance.
[0061] Obtain the intersection of the first and second baselines when the movement stops. This intersection is the midpoint of the standard magnet.
[0062] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0063] The aforementioned proportional transformation of the polar coordinate grid directly compensates for the radial dimension scaling of different batches of magnets. When the overall size of the magnet increases or decreases, the concentric circle pole diameters of the polar coordinate grid are scaled proportionally, but the angle and relative radius ratio of the magnetic pole markings in the polar coordinate grid remain unchanged, ensuring that changes in magnet size will not trigger a "non-conforming" alarm. Only the angle / radial offset of the magnetic pole markings themselves will trigger a "non-conforming" alarm.
[0064] When the polar coordinate grid is mapped onto the image of the magnet to be detected, it can be aligned by rotation. The purpose is to rotate the concentric circles to the position that coincides with the feature points, so that the detection focuses on the polar radius and polar angle deviation of the magnetic pole markings relative to the center of the circle, rather than the absolute pixel coordinates, thus eliminating the interference of circumferential rotation during magnet transport on the detection of magnetic pole markings. Attached Figure Description
[0065] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0066] Figure 1 This is the main flowchart of the magnetic pole marking detection method;
[0067] Figure 2 This is a schematic diagram showing the distribution of the first and second sample point sets on a standard magnet.
[0068] Figure 3 This is the third sample point set on the magnetic pole label S;
[0069] Figure 4 This is the third sample point set on magnetic pole label N;
[0070] Figure 5 This is the fourth sample point set on the magnetic pole label S;
[0071] Figure 6 This is the fourth sample point set on magnetic pole label N;
[0072] Figure 7 A schematic diagram of a polar coordinate grid rotating around a fixed point on the grid;
[0073] Figure 8 A schematic diagram of the first and second baselines on the first standard image;
[0074] Figure 9 This is a system block diagram for magnetic pole marking detection.
[0075] The attached diagram shows the markings and corresponding component names:
[0076] 1. Image acquisition module; 2. Extraction module; 3. Mesh creation module; 4. Detection module; 51. First sample point set; 52. Second sample point; 53. Third sample point set; 531. First upper endpoint; 532. First right endpoint; 533. First left endpoint; 534. Second right endpoint; 535. Second left endpoint; 536. First lower endpoint; 537. Second upper endpoint; 538. Third right endpoint; 539. Third left endpoint; 530. Second lower endpoint; 54. Fourth sample point set; 6. Mesh positioning. Detailed Implementation
[0077] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.
[0078] First embodiment:
[0079] A method for detecting the magnetic pole markings of a magnet, see [link to relevant documentation]. Figure 1 This includes the following steps:
[0080] Obtain a standard magnet image and extract sample points from the standard magnet image; establish a polar coordinate grid based on the sample points of the standard magnet image; wherein, the polar coordinate grid is used to draw concentric circles through the sample points;
[0081] Acquire an image of the magnet to be detected, and extract feature points corresponding to the sample points from the image of the magnet to be detected;
[0082] The above polar coordinate grid is mapped onto the image of the magnet to be detected, and the above polar coordinate grid is transformed proportionally. It is then determined whether each concentric circle of the transformed polar coordinate grid coincides with the corresponding feature point on the image of the magnet to be detected.
[0083] If yes, then the above magnetic pole markings are qualified; otherwise, the above magnetic pole markings are unqualified.
[0084] The aforementioned proportional transformation of the polar coordinate grid directly compensates for the radial dimension scaling of different batches of magnets. When the overall size of the magnet increases or decreases, the concentric circle pole diameters of the polar coordinate grid are scaled proportionally, but the angle and relative radius ratio of the magnetic pole markings in the polar coordinate grid remain unchanged, ensuring that changes in magnet size will not trigger a "non-conforming" alarm. Only the angle / radial offset of the magnetic pole markings themselves will trigger a "non-conforming" alarm.
[0085] When the polar coordinate grid is mapped onto the image of the magnet to be detected, it can be aligned by rotation. The purpose is to rotate the concentric circles to the position that coincides with the feature points, so that the detection focuses on the polar radius and polar angle deviation of the magnetic pole markings relative to the center of the circle, rather than the absolute pixel coordinates, thus eliminating the interference of circumferential rotation during magnet transport on the detection of magnetic pole markings.
[0086] Second embodiment:
[0087] Based on the first embodiment, a polar coordinate grid is established based on sample points of the aforementioned standard magnet image, including the following steps:
[0088] The standard magnet is extracted from the aforementioned standard magnet image to obtain a first standard image; the edge points of the standard magnet are extracted from the first standard image to obtain a first sample point set 51; the midpoint of the standard magnet is determined based on the first sample point set 51 to obtain a second sample point 52, see [link to relevant documentation]. Figure 2 ;
[0089] Magnetic pole markings are extracted from the aforementioned standard magnet image to obtain a second standard image; multiple magnetic pole marking endpoints are extracted from the aforementioned second standard image to obtain a third sample point set 53; for the magnetic pole marking S, the aforementioned multiple magnetic pole marking endpoints include the first upper endpoint 531, the first lower endpoint 536, the first left endpoint 533, the second left endpoint 535, the first right endpoint 532, and the second right endpoint 534 of the magnetic pole marking, see [reference]. Figure 3 For the magnetic pole designation N, the aforementioned pole designation endpoints include the second upper endpoint 537, the second lower endpoint 530, the third left endpoint 539, and the third right endpoint 538. (See also...) Figure 4 .
[0090] The midpoints between the endpoints of adjacent magnetic pole markings are extracted from the second standard image described above to obtain the fourth sample point set 54. (See [link]). Figure 5 and Figure 6 ;
[0091] By superimposing the first and second standard images, a third standard image is obtained; a polar coordinate system is established on the third standard image with the second sample point 52 as the pole, and the first sample point set 51, the second sample point 52, the third sample point set 53 and the fourth sample point set 54 are mapped to the polar coordinate system.
[0092] On the mapped polar coordinate system, draw concentric circles passing through the first sample point set 51, the third sample point set 53, and the fourth sample point set 54; the center of the concentric circles coincides with the pole.
[0093] By extracting a polar coordinate window within the concentric circle of the first sample point set 51, a polar coordinate grid is obtained.
[0094] The outer contour of the standard magnet is determined by the edge points of the standard magnet, the boundary of the magnetic pole mark is determined by the endpoints of the magnetic pole mark, and whether the magnetic pole mark is deformed is determined by the midpoint between the endpoints of adjacent magnetic pole marks. The midpoint between the endpoints of adjacent magnetic pole marks reduces the extraction of sample points and ensures the detection of deformation of the magnetic pole mark, thereby improving the detection efficiency.
[0095] The endpoints of the aforementioned magnetic pole labels and the midpoints between adjacent magnetic pole label endpoints are mapped onto the same polar coordinate grid. When the aforementioned polar coordinate grid is transformed proportionally, the outer concentric circles (i.e., the concentric circles through the first sample point set 51) and the inner concentric circles (i.e., the concentric circles through the third sample point set 53 and the fourth sample point set 54) are scaled synchronously, thus resolving the possibility of misjudging normal magnetic pole labels on a large magnet as magnetic pole label offsets.
[0096] Third embodiment:
[0097] Based on any of the above embodiments, mapping the polar coordinate grid onto the image of the magnet to be detected includes the following steps:
[0098] Extract the edge points of the magnet to be detected from the above image of the magnet to be detected, and take any edge point as grid point 6;
[0099] The aforementioned polar coordinate grid coincides with grid point 6 via the concentric circle of the first sample point set 51;
[0100] Rotate the polar coordinate grid until only grid point 6 coincides with the edge of the magnet to be tested. See [link to relevant documentation]. Figure 7 .
[0101] First, rotate the above polar coordinate grid to prepare for the concentric circles of the outer contour to coincide with the edge points of the magnet to be detected. At this time, there may be a situation where the concentric circles of the outer contour completely coincide with the edge points of the magnet to be detected. In this case, the polar coordinate grid is not transformed proportionally, and it is directly determined whether each concentric circle of the above polar coordinate grid coincides with the corresponding feature point on the image of the magnet to be detected.
[0102] In a specific embodiment, the polar coordinate grid is proportionally transformed until the polar coordinate grid coincides with multiple edge points of the magnet to be detected through the concentric circles of the first sample point set 51.
[0103] Using multiple edge points of the magnet under test for overlap verification, rather than a single point, enhances robustness to size scaling. During magnet manufacturing, individual edge points may not necessarily coincide.
[0104] By proportionally transforming the above polar coordinate grid, the deviation caused by the difference in magnet size is compensated. After the transformation, the above polar coordinate grid can truly reflect the relative position of the magnetic pole markings under the standard size, eliminating the misjudgment of magnetic pole marking deviation caused by the difference in magnet size.
[0105] Fourth embodiment:
[0106] Based on the second embodiment, the midpoint of the standard magnet is determined based on the first sample point set 51 described above, including the following steps:
[0107] A first and second reference lines are projected onto the aforementioned first standard image, intersecting each other at two edge points of the standard magnet. (See also...) Figure 8 ;
[0108] Move the first reference line until the two edge points of the standard magnet intersect at the first reference line at the maximum distance; and move the second reference line until the two edge points of the standard magnet intersect at the second reference line at the maximum distance.
[0109] Obtain the intersection of the first and second baselines when the movement stops. This intersection is the midpoint of the standard magnet.
[0110] For a circular magnet, the center is determined by finding the intersection of the longest chords.
[0111] Fifth embodiment:
[0112] A magnetic pole marking detection system for a magnet, wherein the magnetic pole marking detection system employs any of the above-mentioned magnetic pole marking detection methods;
[0113] See Figure 9 The magnetic pole marking detection system includes:
[0114] Image acquisition module 1, which is used to acquire images of a standard magnet and an image of the magnet to be detected;
[0115] Extraction module 2 is connected to image acquisition module 1; extraction module 2 is used to extract sample points from standard magnet images and extract feature points corresponding to the sample points from the magnet images to be detected.
[0116] Mesh creation module 3 is connected to extraction module 2; mesh creation module 3 establishes a polar coordinate mesh based on sample points of the standard magnet image; wherein, the polar coordinate mesh is used to draw concentric circles through the sample points;
[0117] Detection module 4, which is connected to mesh creation module 3 and extraction module 2; detection module 4 is used to perform the following steps:
[0118] The above polar coordinate grid is mapped onto the image of the magnet to be detected, and the above polar coordinate grid is transformed proportionally. It is then determined whether each concentric circle of the transformed polar coordinate grid coincides with the corresponding feature point on the image of the magnet to be detected.
[0119] If yes, then the above magnetic pole markings are qualified; otherwise, the above magnetic pole markings are unqualified.
[0120] By using polar coordinate grid mapping and proportional transformation, the polar coordinate grid can be dynamically adjusted adaptively according to the actual size of the magnet under test during each inspection. The relative proportion is used as the judgment criterion, rather than using a preset fixed pixel distance as the pass standard. This helps to reduce false alarms caused by batch size fluctuations of magnets on industrial production lines.
[0121] Sixth embodiment:
[0122] Based on the fifth embodiment, the steps of the mesh creation module 3 for establishing a polar coordinate mesh include:
[0123] The extraction module 2 described above performs the following steps:
[0124] The standard magnet is extracted from the above standard magnet image to obtain a first standard image; the edge points of the standard magnet are extracted from the first standard image to obtain a first sample point set 51; the midpoint of the standard magnet is determined based on the first sample point set 51 to obtain a second sample point 52.
[0125] Magnetic pole markings are extracted from the above standard magnet images to obtain a second standard image; multiple magnetic pole marking endpoints are extracted from the above second standard image to obtain a third sample point set 53;
[0126] The midpoint between the endpoints of adjacent magnetic pole labels is extracted from the second standard image above to obtain the fourth sample point set 54;
[0127] The following steps are performed by the mesh creation module 3 described above:
[0128] By superimposing the first and second standard images, a third standard image is obtained; a polar coordinate system is established on the third standard image with the second sample point 52 as the pole, and the first sample point set 51, the second sample point 52, the third sample point set 53 and the fourth sample point set 54 are mapped to the polar coordinate system.
[0129] On the mapped polar coordinate system, draw concentric circles passing through the first sample point set 51, the third sample point set 53, and the fourth sample point set 54; the center of the concentric circles coincides with the pole.
[0130] By extracting a polar coordinate window within the concentric circle of the first sample point set 51, a polar coordinate grid is obtained.
[0131] Seventh embodiment:
[0132] Based on the fifth embodiment, the detection module 4 described above is used to map the polar coordinate grid onto the image of the magnet to be detected, including the following steps:
[0133] Extract the edge points of the magnet to be detected from the above image of the magnet to be detected, and take any edge point as grid point 6;
[0134] The aforementioned polar coordinate grid coincides with grid point 6 via the concentric circle of the first sample point set 51;
[0135] Rotate the polar coordinate grid until only grid point 6 coincides with the edge point of the magnet to be detected.
[0136] Eighth embodiment:
[0137] Based on the sixth embodiment, the extraction module 2 determines the midpoint of the standard magnet based on the first sample point set 51, including the following steps:
[0138] A first reference line and a second reference line are projected onto the first standard image, and the first reference line and the second reference line intersect with the two edge points of the standard magnet, respectively.
[0139] Move the first reference line until the two edge points of the standard magnet intersect at the first reference line at the maximum distance; and move the second reference line until the two edge points of the standard magnet intersect at the second reference line at the maximum distance.
[0140] Obtain the intersection of the first and second baselines when the movement stops. This intersection is the midpoint of the standard magnet.
[0141] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for detecting the magnetic pole markings of a magnet, characterized in that, Includes the following steps: Acquire a standard magnet image, and extract sample points from the standard magnet image; A polar coordinate grid is established based on sample points of the standard magnet image; wherein, the polar coordinate grid is used to draw concentric circles through the sample points; Acquire an image of the magnet to be detected, and extract feature points corresponding to the sample points from the image of the magnet to be detected; The polar coordinate grid is mapped onto the image of the magnet to be detected, and the polar coordinate grid is transformed proportionally. It is then determined whether each concentric circle of the transformed polar coordinate grid coincides with the corresponding feature point on the image of the magnet to be detected. If yes, then the magnetic pole marking is qualified; otherwise, the magnetic pole marking is unqualified.
2. The magnetic pole marking detection method according to claim 1, characterized in that, The process of establishing a polar coordinate grid based on sample points from the standard magnet image includes the following steps: The standard magnet is extracted from the standard magnet image to obtain a first standard image; the edge points of the standard magnet are extracted from the first standard image to obtain a first sample point set (51); the midpoint of the standard magnet is determined based on the first sample point set (51) to obtain a second sample point (52); Magnetic pole markings are extracted from the standard magnet image to obtain a second standard image; multiple magnetic pole marking endpoints are extracted from the second standard image to obtain a third sample point set (53); The midpoint between the endpoints of adjacent magnetic pole labels is extracted from the second standard image to obtain the fourth sample point set (54); The first standard image and the second standard image are superimposed to obtain the third standard image; a polar coordinate system is established on the third standard image with the second sample point (52) as the pole, and the first sample point set (51), the second sample point (52), the third sample point set (53) and the fourth sample point set (54) are mapped to the polar coordinate system; On the mapped polar coordinate system, draw concentric circles passing through the first sample point set (51), the third sample point set (53), and the fourth sample point set (54); the center of the concentric circles coincides with the pole; A polar coordinate grid is obtained by extracting a polar coordinate window within the concentric circle of the first sample point set (51).
3. The magnetic pole marking detection method according to claim 2, characterized in that, Mapping the polar coordinate grid onto the image of the magnet to be detected includes the following steps: Extract the edge points of the magnet to be detected from the image of the magnet to be detected, and take any edge point as the grid point (6); The polar coordinate grid coincides with the grid fixed point (6) through the concentric circle of the first sample point set (51); Rotate the polar coordinate grid until the polar coordinate grid coincides with only the grid fixed point (6) of the edge point of the magnet to be detected.
4. The magnetic pole marking detection method according to claim 3, characterized in that, The polar coordinate grid is proportionally transformed until the polar coordinate grid coincides with multiple edge points of the magnet to be detected through the concentric circles of the first sample point set (51).
5. The magnetic pole marking detection method according to claim 2, characterized in that, The midpoint of the standard magnet is determined based on the first sample point set (51), including the following steps: A first reference line and a second reference line are projected onto the first standard image, and the first reference line and the second reference line intersect with the two edge points of the standard magnet, respectively. Move the first reference line until the two edge points of the standard magnet intersect at the first reference line at the maximum distance; and move the second reference line until the two edge points of the standard magnet intersect at the second reference line at the maximum distance. Obtain the intersection point of the first and second baselines when the movement stops, where the intersection point is the midpoint of the standard magnet.
6. A magnetic pole marking detection system for a magnet, characterized in that, The magnetic pole marking detection system employs the magnetic pole marking detection method described in any one of claims 1 to 5; The magnetic pole marking detection system includes: Image acquisition module (1), the image acquisition module (1) is used to acquire standard magnet images and magnet images to be detected; Extraction module (2), which is connected to image acquisition module (1); the extraction module (2) is used to extract sample points from standard magnet images and extract feature points corresponding to the sample points from the magnet image to be detected; A grid creation module (3) is connected to an extraction module (2); the grid creation module (3) establishes a polar coordinate grid based on sample points of the standard magnet image; wherein, the polar coordinate grid is used to draw concentric circles through the sample points; The detection module (4) is connected to the mesh creation module (3) and the extraction module (2); the detection module (4) is used to perform the following steps: The polar coordinate grid is mapped onto the image of the magnet to be detected, and the polar coordinate grid is transformed proportionally. It is then determined whether each concentric circle of the transformed polar coordinate grid coincides with the corresponding feature point on the image of the magnet to be detected. If yes, then the magnetic pole marking is qualified; otherwise, the magnetic pole marking is unqualified.
7. The magnetic pole marking detection system according to claim 6, characterized in that, The steps for establishing a polar coordinate grid by the grid creation module (3) include: The extraction module (2) performs the following steps: The standard magnet is extracted from the standard magnet image to obtain a first standard image; the edge points of the standard magnet are extracted from the first standard image to obtain a first sample point set (51); the midpoint of the standard magnet is determined based on the first sample point set (51) to obtain a second sample point (52); Magnetic pole markings are extracted from the standard magnet image to obtain a second standard image; multiple magnetic pole marking endpoints are extracted from the second standard image to obtain a third sample point set (53); The midpoint between the endpoints of adjacent magnetic pole labels is extracted from the second standard image to obtain the fourth sample point set (54); The following steps are performed by the mesh creation module (3): The first standard image and the second standard image are superimposed to obtain the third standard image; a polar coordinate system is established on the third standard image with the second sample point (52) as the pole, and the first sample point set (51), the second sample point (52), the third sample point set (53) and the fourth sample point set (54) are mapped to the polar coordinate system; On the mapped polar coordinate system, draw concentric circles passing through the first sample point set (51), the third sample point set (53), and the fourth sample point set (54); the center of the concentric circles coincides with the pole; A polar coordinate grid is obtained by extracting a polar coordinate window within the concentric circle of the first sample point set (51).
8. The magnetic pole marking detection system according to claim 7, characterized in that, The detection module (4) is used to map the polar coordinate grid onto the image of the magnet to be detected, including the following steps: Extract the edge points of the magnet to be detected from the image of the magnet to be detected, and take any edge point as the grid point (6); The polar coordinate grid coincides with the grid fixed point (6) through the concentric circle of the first sample point set (51); Rotate the polar coordinate grid until the polar coordinate grid coincides with only the grid fixed point (6) of the edge point of the magnet to be detected.
9. The magnetic pole marking detection system according to claim 7, characterized in that, The extraction module (2) determines the midpoint of the standard magnet based on the first sample point set (51), including the following steps: A first reference line and a second reference line are projected onto the first standard image, and the first reference line and the second reference line intersect with the two edge points of the standard magnet, respectively. Move the first reference line until the two edge points of the standard magnet intersect at the first reference line at the maximum distance; and move the second reference line until the two edge points of the standard magnet intersect at the second reference line at the maximum distance. Obtain the intersection point of the first and second baselines when the movement stops, where the intersection point is the midpoint of the standard magnet.