Magnetic flux detection method and apparatus
By combining a vision system and a 3D magnetic field camera with a laser displacement sensor and utilizing pre-calibrated positional relationships, the limitations of existing magnetic flux detection technologies have been overcome, enabling efficient and accurate magnetic flux data acquisition.
Patent Information
- Application Number
- PCT/CN2025/145097
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-05-19
- Filing Date
- 2025-12-24
- Publication Date
- 2026-11-26
AI Technical Summary
Existing magnetic flux detection methods can only obtain magnetic flux values at a single point or along a line, and cannot measure the magnetic flux values at all points within the field of view. Furthermore, their measurement accuracy and efficiency are relatively low.
By employing a combination of a vision system, a three-dimensional magnetic field camera, and a laser displacement sensor, the measurement positions of the laser displacement sensor and the three-dimensional magnetic field camera are determined through pre-calibrated positional relationships, enabling the acquisition of magnetic flux data at all points within the field of view.
It improves the accuracy and efficiency of magnetic flux detection, enabling the acquisition of magnetic flux data from all points within the field of view in a single operation.
Smart Images

Figure CN2025145097_26112026_PF_FP_ABST
Abstract
Description
A method and apparatus for detecting magnetic flux Technical Field
[0001] This invention relates to the field of magnetic flux detection technology, and in particular to a magnetic flux detection method and apparatus. Background Technology
[0002] In recent years, magnets have been used more and more in mobile phones, computers, tablets, new energy vehicles and other products. The magnetic flux intensity, magnetic pole position and other parameters of magnets directly affect the product experience, and some even directly affect the product's operating efficiency.
[0003] In related technologies, magnetic flux is typically detected using a single-point magnetic flux measurement sensor. However, this technology can only obtain the magnetic flux value at one point. When combined with motion control, it can obtain the magnetic flux value along a line, but it cannot measure the magnetic flux value at all points within the field of view, which limits the magnetic flux detection method. In addition, the single-point magnetic flux measurement sensor used in related technologies results in low measurement accuracy and detection efficiency. Summary of the Invention
[0004] To address the above problems, the present invention provides a magnetic flux detection method and apparatus.
[0005] On one hand, the present invention provides a magnetic flux detection method, which is applied to a detection device. The detection device includes a vision system, a three-dimensional magnetic field camera, a laser displacement sensor, a horizontal axis, a vertical axis, and a test product fixed on the detection device. The magnetic flux detection method includes: acquiring a reference point of the test product based on the vision system; determining a first position of a target magnet relative to the reference point in the test product, a second position of the horizontal and vertical axes when measured by the vision system, and a third position of the magnet center of the target magnet relative to the reference point in the vision system; determining a fourth position of the horizontal and vertical axes when measured by the laser displacement sensor based on a first positional relationship between the laser and the vision system, the first position, the second position, and the third position; controlling the laser displacement sensor to move to the fourth position, acquiring a fifth position of the vertical axis and a target reading of the laser displacement sensor; and determining the vertical axis position when measured by the three-dimensional magnetic field camera based on a second positional relationship between the three-dimensional magnetic field camera and the laser, the fifth position, the target reading, and the target measurement gap. Based on the third positional relationship between the three-dimensional magnetic field camera and vision, the first position, the second position, and the third position are used to determine the horizontal and vertical axis positions of the three-dimensional magnetic field camera during measurement; the three-dimensional magnetic field camera is controlled to acquire target magnetic flux data at the horizontal and vertical axis positions.
[0006] In an optional embodiment, determining the fourth position of the horizontal and vertical axes during laser displacement sensor measurement based on the first positional relationship between laser and vision, the first position, the second position, and the third position, includes: acquiring a pre-calibrated first positional relationship; the first positional relationship characterizing the correspondence between the sum of the first positions and the sum of the second positions, wherein the first position sum is the sum of the positions of the horizontal and vertical axes during laser displacement sensor measurement and a first fixed deviation, and the second position sum is the sum of the positions of the horizontal and vertical axes during vision system measurement and the position of the magnet center in the vision system; and determining the fourth position as the difference between a first target position and the first fixed deviation based on the first positional relationship; wherein the first target position is determined based on the first position, the second position, and the third position.
[0007] In an optional embodiment, determining the vertical axis position of the three-dimensional magnetic field camera during measurement based on the second positional relationship between the three-dimensional magnetic field camera and the laser, the fifth position, the target reading, and the target measurement gap includes: acquiring a pre-calibrated second positional relationship; the second positional relationship is used to characterize the correspondence between the sum of the third position and the sum of the fourth position, the sum of the third position being the sum of the vertical axis position, the measurement gap, and the second fixed deviation during measurement by the three-dimensional magnetic field camera, and the sum of the fourth position being the sum of the position of the vertical axis measured by the laser displacement sensor and the reading of the laser displacement sensor; based on the second positional relationship, determining that the vertical axis position during measurement by the three-dimensional magnetic field camera is equal to the difference between the second target position and the third target position; wherein, the second target position is determined based on the fifth position and the target reading, and the third target position is determined based on the second fixed deviation and the target measurement gap.
[0008] In an optional embodiment, determining the horizontal and vertical axis positions of the three-dimensional magnetic field camera during measurement based on the third positional relationship between the three-dimensional magnetic field camera and the vision system, and the first, second, and third positions, includes: acquiring the pre-calibrated third positional relationship; the third positional relationship is used to characterize the correspondence between the sum of the fifth and sixth positions, wherein the sum of the fifth positions is the sum of the horizontal and vertical axis positions during measurement by the three-dimensional magnetic field camera, the position of the magnet center in the three-dimensional magnetic field camera, and the third fixed deviation, and the sum of the sixth positions is the sum of the positions of the horizontal and vertical axes during measurement by the vision system and the position of the magnet center in the vision system; based on the third positional relationship, determining the positions of the horizontal and vertical axes during measurement by the three-dimensional magnetic field camera as the difference between the fourth target position and the fifth target position; wherein the fourth target position is determined based on the first, second, and third positions, and the fifth target position is determined based on the third fixed deviation and the position of the magnet center in the three-dimensional magnetic field camera.
[0009] In an optional embodiment, the method further includes: calibrating the vision system; controlling the vision system to move above a preset magnet, acquiring a first preset position of the horizontal and vertical axes during measurement by the vision system, and determining a second preset position of the magnet center of the preset magnet in the vision system; wherein the preset magnet is fixed on the detection device; controlling the laser displacement sensor to move to the center position of the preset magnet, acquiring a third preset position of the horizontal and vertical axes, a fourth preset position of the vertical axis, and a preset reading of the laser displacement sensor during measurement by the laser displacement sensor; controlling the three-dimensional magnetic field camera to move above the preset magnet, acquiring a fifth preset position of the horizontal and vertical axes, a sixth preset position of the vertical axis, and a preset measurement gap of the three-dimensional magnetic field camera during measurement by the three-dimensional magnetic field camera; acquiring preset magnetic flux data based on the three-dimensional magnetic field camera, and determining a seventh preset position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; The first positional relationship is obtained by setting the correspondence between the sum of the third preset position and the first fixed deviation, and the sum of the first preset position and the second preset position; the second positional relationship is obtained by setting the correspondence between the sixth preset position, the preset measurement gap, the sum of the second fixed deviation, and the sum of the fourth preset position and the preset reading value; the third positional relationship is obtained by setting the correspondence between the fifth preset position, the seventh preset position, the sum of the third fixed deviation, and the sum of the first preset position and the second preset position.
[0010] In an optional embodiment, setting the correspondence between the sum of the third preset position and the first fixed deviation, and the sum of the first preset position and the second preset position to obtain the first positional relationship includes: setting the sum of the third preset position and the first fixed deviation to be equal to the sum of the first preset position and the second preset position to obtain the first positional relationship; setting the correspondence between the sixth preset position, the preset measurement gap, the second fixed deviation, and the sum of the fourth preset position and the preset reading value to obtain the second positional relationship includes: setting the sum of the sixth preset position, the preset measurement gap, and the second fixed deviation to be equal to the sum of the fourth preset position and the preset reading value to obtain the second positional relationship; setting the correspondence between the fifth preset position, the seventh preset position, the third fixed deviation, and the sum of the first preset position and the second preset position to obtain the third positional relationship includes: setting the sum of the fifth preset position, the seventh preset position, and the third fixed deviation to be equal to the sum of the first preset position and the second preset position to obtain the third positional relationship.
[0011] In an optional embodiment, determining the seventh preset position of the magnet center of the preset magnet in the three-dimensional magnetic field camera includes: determining a first initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; rotating the preset magnet by 90° to determine a second initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; continuing to rotate the preset magnet by 90° to determine a third initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; continuing to rotate the preset magnet by 90° to determine a fourth initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; and determining the average of the first, second, third, and fourth initial positions to obtain the seventh preset position.
[0012] In an optional embodiment, after the three-dimensional magnetic field camera acquires target magnetic flux data at the horizontal and vertical axis positions, the method further includes: converting the target magnetic flux data into a magnetic field heatmap; connecting the magnetic flux data in the magnetic field heatmap that meet preset conditions to obtain a connected region; using the magnetic flux data in the connected region that is greater than a magnetic field data threshold as the magnetic field peak value, and using the average value of all magnetic flux data in the connected region as the position data of the target magnet.
[0013] In an optional embodiment, the method further includes: acquiring at least one scan segment passing through the target magnet on the magnetic field thermogram; acquiring magnetic flux data located on the at least one scan segment from the target magnetic flux data; and analyzing the magnetic flux data located on the at least one scan segment to obtain the magnetic field peak value and magnetic pole width of the at least one scan segment.
[0014] On the other hand, the present invention provides a magnetic flux detection device, which is applied to a detection equipment. The detection equipment includes a vision system, a three-dimensional magnetic field camera, a laser displacement sensor, a horizontal axis, a vertical axis, and a horizontal axis. A product to be tested is fixed on the detection equipment. The magnetic flux detection device includes: a first determining module, used to acquire a reference point of the product to be tested based on the vision system; determine a first position of a target magnet relative to the reference point in the product to be tested, a second position of the horizontal and vertical axes when measured by the vision system, and a third position of the magnet center of the target magnet relative to the reference point in the vision system; a first laser positioning module, used to determine a fourth position of the horizontal and vertical axes when measured by the laser displacement sensor based on a first positional relationship between the laser and the vision system, the first position, the second position, and the third position; a second laser positioning module, used to control the laser displacement sensor to move to the fourth position, acquire a fifth position of the vertical axis, and acquire a target reading of the laser displacement sensor; and a first camera positioning module, used to determine the vertical axis position when measured by the three-dimensional magnetic field camera based on a second positional relationship between the three-dimensional magnetic field camera and the laser, the fifth position, the target reading, and the target measurement gap. The second camera positioning module is used to determine the horizontal and vertical axis positions of the three-dimensional magnetic field camera during measurement based on the third positional relationship between the three-dimensional magnetic field camera and vision, namely the first position, the second position, and the third position; the magnetic flux acquisition module is used to control the three-dimensional magnetic field camera to acquire target magnetic flux data at the horizontal and vertical axis positions.
[0015] In an optional embodiment, the first laser positioning module includes: a first position relationship acquisition module, configured to acquire a pre-calibrated first position relationship; the first position relationship is used to characterize the correspondence between a first position sum and a second position sum, wherein the first position sum is the sum of the positions of the horizontal and vertical axes measured by the laser displacement sensor and a first fixed deviation, and the second position sum is the sum of the positions of the horizontal and vertical axes measured by the vision system and the position of the magnet center in the vision system; and a first difference determination module, configured to determine, based on the first position relationship, the fourth position as the difference between the first target position and the first fixed deviation; wherein the first target position is determined based on the first position, the second position, and the third position.
[0016] In an optional embodiment, the first camera positioning module includes: a second position relationship acquisition module, configured to acquire a pre-calibrated second position relationship; the second position relationship is used to characterize the correspondence between a third position sum and a fourth position sum, wherein the third position sum is the sum of the vertical axis position, measurement gap, and second fixed deviation during measurement by the three-dimensional magnetic field camera, and the fourth position sum is the sum of the position of the vertical axis measured by the laser displacement sensor and the reading of the laser displacement sensor; and a second difference determination module, configured to determine, based on the second position relationship, that the vertical axis position during measurement by the three-dimensional magnetic field camera is equal to the difference between a second target position and a third target position; wherein the second target position is determined based on the fifth position and the target reading, and the third target position is determined based on the second fixed deviation and the target measurement gap.
[0017] In an optional embodiment, the second camera positioning module includes: a third position relationship acquisition module, configured to acquire a pre-calibrated third position relationship; the third position relationship is used to characterize the correspondence between the sum of the fifth position and the sum of the sixth position, wherein the sum of the fifth position is the sum of the horizontal and vertical axis positions when the three-dimensional magnetic field camera is measuring, the position of the magnet center in the three-dimensional magnetic field camera, and the third fixed deviation, and the sum of the sixth position is the sum of the positions of the horizontal and vertical axes when the vision system is measuring, and the position of the magnet center in the vision system; and a third difference determination module, configured to determine, based on the third position relationship, the difference between the positions of the horizontal and vertical axes when the three-dimensional magnetic field camera is measuring and the fourth target position and the fifth target position; wherein the fourth target position is determined based on the first position, the second position, and the third position, and the fifth target position is determined based on the third fixed deviation and the position of the magnet center in the three-dimensional magnetic field camera.
[0018] In an optional embodiment, the device further includes: a vision system calibration module for calibrating the vision system; a first movement module for controlling the vision system to move above a preset magnet, acquiring a first preset position of the horizontal and vertical axes during measurement by the vision system, and determining a second preset position of the magnet center of the preset magnet in the vision system; wherein the preset magnet is fixed on the detection device; a second movement module for controlling the laser displacement sensor to move to the center position of the preset magnet, acquiring a third preset position of the horizontal and vertical axes during measurement by the laser displacement sensor, a fourth preset position of the vertical axis, and a preset reading of the laser displacement sensor; a third movement module for controlling the three-dimensional magnetic field camera to move above the preset magnet, acquiring a fifth preset position of the horizontal and vertical axes during measurement by the three-dimensional magnetic field camera, a sixth preset position of the vertical axis, and a preset measurement gap of the three-dimensional magnetic field camera; and a position determination module for acquiring preset magnetic flux data based on the three-dimensional magnetic field camera, and determining a seventh preset position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; The positional relationship determination module is used to set the correspondence between the sum of the third preset position and the first fixed deviation, and the sum of the first preset position and the second preset position, to obtain the first positional relationship; set the correspondence between the sum of the sixth preset position, the preset measurement gap, the second fixed deviation, and the sum of the fourth preset position and the preset reading value, to obtain the second positional relationship; and set the correspondence between the fifth preset position, the seventh preset position, the sum of the third fixed deviation, and the sum of the first preset position and the second preset position, to obtain the third positional relationship.
[0019] In an optional embodiment, the positional relationship determination module includes: a first positional relationship determination unit, configured to set the sum of the third preset position and the first fixed deviation to be equal to the sum of the first preset position and the second preset position, thereby obtaining the first positional relationship; a second positional relationship determination unit, configured to set the sum of the sixth preset position, the preset measurement gap, and the second fixed deviation to be equal to the sum of the fourth preset position and the preset reading value, thereby obtaining the second positional relationship; and a third positional relationship determination unit, configured to set the sum of the fifth preset position, the seventh preset position, and the third fixed deviation to be equal to the sum of the first preset position and the second preset position, thereby obtaining the third positional relationship.
[0020] In an optional embodiment, the position determination module includes: a first initial position determination unit, configured to determine a first initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; a second initial position determination unit, configured to rotate the preset magnet by 90° to determine a second initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; a third initial position determination unit, configured to continue rotating the preset magnet by 90° to determine a third initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; a fourth initial position determination unit, configured to continue rotating the preset magnet by 90° to determine a fourth initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; and a seventh preset position determination unit, configured to determine the average of the first, second, third, and fourth initial positions to obtain the seventh preset position.
[0021] In an optional embodiment, the device further includes: a conversion module for converting the target magnetic flux data into a magnetic field heatmap; a connected component determination module for connecting magnetic flux data in the magnetic field heatmap that meet preset conditions to obtain a connected component; and a peak position determination module for taking magnetic flux data in the connected component that are greater than a magnetic field data threshold as the magnetic field peak value, and taking the average value of all magnetic flux data in the connected component as the position data of the target magnet.
[0022] In an optional embodiment, the apparatus further includes: a scan segment generation module, configured to acquire at least one scan segment passing through the target magnet on the magnetic field thermogram; a scan segment data acquisition module, configured to acquire magnetic flux data located on the at least one scan segment from the target magnetic flux data; and a peak width determination module, configured to analyze the magnetic flux data located on the at least one scan segment to obtain the magnetic field peak value and magnetic pole width of the at least one scan segment.
[0023] On the other hand, an electronic device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the magnetic flux detection method as described above.
[0024] On the other hand, a computer storage medium is provided that stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the magnetic flux detection method as described above.
[0025] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the magnetic flux detection method as described above.
[0026] The magnetic flux detection method and apparatus provided by this invention have the following technical effects: Based on a pre-defined first positional relationship between a laser displacement sensor and a vision system, a first position of the target magnet's center within the product under test, a second position of the horizontal and vertical axes during vision system measurement, and a third position of the target magnet within the vision system, this invention determines a fourth position of the horizontal and vertical axes during laser displacement sensor measurement. The laser displacement sensor is then moved to this fourth position to obtain a fifth position of the vertical axis and the target reading of the laser displacement sensor. Next, based on a pre-calibrated second positional relationship between a three-dimensional magnetic field camera and the laser displacement sensor, the fifth position, the target reading, and the target measurement gap, the three-dimensional magnetic field phase is determined. The vertical axis position during machine measurement is determined, thereby locating the measurement height of the 3D magnetic field camera using laser positioning. Then, based on the pre-calibrated third positional relationship between the 3D magnetic field camera and the vision system, the horizontal and vertical axis positions of the 3D magnetic field camera during measurement are determined using the first, second, and third positions. This enables the vision system to locate the measurement position of the 3D magnetic field camera, allowing the 3D magnetic field camera to collect magnetic flux data from all points within its field of view at once, thus improving the efficiency of magnetic flux measurement. Furthermore, since the magnetic flux data detection is performed using the pre-calibrated first, second, and third positional relationships, the detection accuracy of the magnetic flux data can be improved. Attached Figure Description
[0027] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application, and do not constitute an undue limitation of this application.
[0028] To more clearly illustrate the technical solutions and advantages in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 is a schematic diagram of the structure of a detection device provided in an embodiment of this application.
[0030] Figure 2 is a schematic flowchart of a magnetic flux detection method provided in an embodiment of this application.
[0031] Figure 3 is a schematic flowchart of a calibration process provided in an embodiment of this application.
[0032] Figure 4 is a flowchart illustrating a method for determining the fourth position of the horizontal and vertical axes during laser displacement sensor measurement, according to an embodiment of this application.
[0033] Figure 5 is a flowchart illustrating a method for determining the vertical axis position during a three-dimensional magnetic field camera measurement, as provided in an embodiment of this application.
[0034] Figure 6 is a flowchart illustrating the process of determining the horizontal and vertical axis positions during a three-dimensional magnetic field camera measurement, as provided in an embodiment of this application.
[0035] Figure 7 is a structural block diagram of a magnetic flux detection device provided in an embodiment of this application.
[0036] The figures are labeled as follows: 1-Vision system, 2-3D magnetic field camera, 3-Laser displacement sensor, 4-Horizontal axis, 5-Vertical axis, 6-Vertical axis. Detailed Implementation
[0037] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0038] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0039] Please refer to Figure 1, which is a schematic diagram of the structure of a detection device provided in an embodiment of this application. As shown in Figure 1, the detection device may include at least a vision system 1, a three-dimensional magnetic field camera 2, a laser displacement sensor 3, a horizontal axis (X-axis) 4, a vertical axis (Y-axis) 5, and a vertical axis (Z-axis) 6. The vision system 1 may be a CCD vision system.
[0040] It should be noted that the embodiments of this application do not limit the positional relationship of the vision system 1, the three-dimensional magnetic field camera 2, the laser displacement sensor 3, the horizontal axis 4, the vertical axis 5, and the vertical axis 6. As long as the product to be tested and the preset magnet can be fixed, the vision system 1 can be moved above the magnet, the laser displacement sensor 3 can be moved above the magnet, and the three-dimensional magnetic field camera 2 can be moved above the magnet, so as to measure the target magnetic flux data.
[0041] For example, continuing as shown in Figure 1, the vision system 1 is positioned above the three-dimensional magnetic field camera 2 and the laser displacement sensor 3, which is positioned on the side of the three-dimensional magnetic field camera 2.
[0042] The magnetic flux detection method provided in this application includes a calibration process and a measurement process. During the calibration process, a preset magnet is fixed on the detection device. During the measurement process, the product to be tested is fixed on the detection device, and the fixed position of the product to be tested on the detection device is the same as the fixed position of the preset magnet on the detection device.
[0043] The following describes a magnetic flux detection method according to the present invention. Figure 2 is a schematic flowchart of a magnetic flux detection method provided in an embodiment of this application. This specification provides the operation steps of the method as described in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operation steps may be included. The order of steps listed in the embodiments is only one of many possible execution orders and does not represent the only execution order. When executed in actual systems or server products, the method can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment) as shown in the embodiments or figures. Specifically, as shown in Figure 2, the method may include: S101. Obtaining a reference point of the product under test based on the vision system; determining the first position of the target magnet relative to the reference point in the product under test, the second position of the horizontal and vertical axes when the vision system measures, and the third position of the magnet center of the target magnet relative to the reference point in the vision system.
[0044] In this embodiment, during the actual measurement of the magnetic flux data of the product under test, the product under test can be fixed on the testing equipment, and the vision system can be controlled to move above the product under test to capture the reference point of the product under test. The reference point of the product under test, in engineering drawings, typically refers to the core reference origin used for positioning, measurement, and dimensioning in product design and manufacturing, equivalent to the "zero point" in a three-dimensional coordinate system.
[0045] Since the reference point can be considered the "zero point" of the three-dimensional coordinate system, the first position PM(Mx1, My1) of the target magnet in the product under test relative to the reference point can be obtained. Simultaneously, the second position PV1(VX1, VY1) located on the horizontal and vertical axes by the vision system can be recorded, where VX1 refers to the position on the horizontal axis and VY1 refers to the position on the vertical axis. Furthermore, after determining the reference point, the third position PV2(VX2, VY2) of the target magnet relative to the reference point in the vision system can be determined using the reference point as a reference.
[0046] Optionally, the process of determining the third position of the magnet center of the target magnet relative to the reference point in the vision system can be as follows: taking an image of the target magnet through the vision system, cropping the magnet region from the image, determining the centroid of the magnet region, and taking the position of the centroid relative to the reference point as the third position of the magnet center relative to the reference point in the vision system.
[0047] S103. Based on the first positional relationship between laser and vision, the first position, the second position, and the third position, determine the fourth position where the horizontal and vertical axes of the laser displacement sensor are located during measurement.
[0048] S105. Control the laser displacement sensor to move to the fourth position, and obtain the fifth position where the vertical axis is located and the target reading value of the laser displacement sensor.
[0049] In this embodiment, a first positional relationship between the laser displacement sensor and the vision system can be pre-calibrated. Since the second and third positions are features associated with the vision system, and the first position is the position of the target magnet relative to the reference point in the product under test, the fourth position (LX1, LY1) of the horizontal and vertical axes during laser displacement sensor measurement can be accurately determined based on the pre-calibrated first positional relationship and by combining the first, second, and third positions. LX1 refers to the position of the horizontal axis during laser displacement sensor measurement, and LY1 refers to the position of the vertical axis during laser displacement sensor measurement. The fourth position of the horizontal and vertical axes during laser displacement sensor measurement can refer to the positions of the horizontal and vertical axes that the laser displacement sensor is positioned to during operation.
[0050] After determining the working position of the laser displacement sensor, it can be moved to the fourth position. Since the laser displacement sensor can locate the measurement height (i.e., the vertical axis position) of the three-dimensional magnetic field camera, after moving the laser displacement sensor to the fourth position, the fifth position (LZ1) where the current vertical axis is located can be determined, and the target reading (LV1) of the laser displacement sensor can be read. This target reading can include the distance from the upper surface of the target magnet to the light output port of the laser displacement sensor.
[0051] S107. Based on the second positional relationship between the three-dimensional magnetic field camera and the laser, the fifth position, the target reading, and the target measurement gap, determine the vertical axis position of the three-dimensional magnetic field camera during measurement.
[0052] The target measurement gap (SG) is a preset value, which refers to the distance from the upper surface of the target magnet to the measurement surface of the three-dimensional magnetic field camera.
[0053] In this embodiment, a second positional relationship between the three-dimensional magnetic field camera and the laser displacement sensor can be pre-calibrated. Since the fifth position, target reading, and target measurement gap are all features associated with the laser displacement sensor, the position of the three-dimensional magnetic field camera can be determined based on this second positional relationship and the aforementioned features associated with the laser displacement sensor. Furthermore, since the laser displacement sensor can locate the measurement height (i.e., vertical axis position) of the three-dimensional magnetic field camera, the vertical axis position of the three-dimensional magnetic field camera during measurement, i.e., the vertical axis position (SZ) where the three-dimensional magnetic field camera is operating, can be obtained quickly and accurately based on the second positional relationship and the aforementioned features associated with the laser displacement sensor.
[0054] S109. Based on the third positional relationship between the three-dimensional magnetic field camera and vision, the first position, the second position, and the third position are used to determine the horizontal and vertical axis positions of the three-dimensional magnetic field camera during measurement.
[0055] In this embodiment, a third positional relationship between the 3D magnetic field camera and the vision system can be pre-calibrated. Since the first, second, and third positions are all parameters associated with the vision system, the position of the 3D magnetic field camera during measurement can be obtained quickly and accurately based on this third positional relationship and the parameters associated with the vision system. Furthermore, since the vision system can locate the measurement position of the 3D magnetic field camera, the horizontal and vertical positions of the 3D magnetic field camera during measurement can be obtained quickly and accurately based on this third positional relationship and the parameters associated with the vision system.
[0056] S1011. Control the three-dimensional magnetic field camera to acquire target magnetic flux data at the horizontal axis, vertical axis and vertical axis positions.
[0057] In this embodiment of the application, after obtaining the horizontal and vertical axis positions of the three-dimensional magnetic field camera during measurement, the three-dimensional magnetic field camera can be moved to the position where the horizontal and vertical axis positions are located, and the three-dimensional magnetic field camera can be controlled to acquire target magnetic flux data at that position.
[0058] It should be noted that steps S101-S1011 can be performed for different target magnets to obtain the target magnetic flux data corresponding to different target magnets.
[0059] This application embodiment achieves the positioning of the three-dimensional magnetic field camera through a vision system and the positioning of its height through a laser displacement sensor, thereby enabling the three-dimensional magnetic field camera to collect magnetic flux data (Bx, By, Bz) of all points within its field of view at once. Moreover, the X and Y intervals of each collection point are known, improving the measurement efficiency of magnetic flux. In addition, since the magnetic flux data is detected using pre-calibrated first, second, and third positional relationships, the detection accuracy of the magnetic flux data can be improved.
[0060] First, the calibration process for the first positional relationship, the second positional relationship, and the third positional relationship described above will be explained. Figure 3 is a flowchart illustrating a calibration process provided in an embodiment of this application. As shown in Figure 3, the calibration process includes: S201. Calibrating the vision system.
[0061] Optionally, visual calibration can be performed by moving the motion axes (horizontal, vertical, and longitudinal axes) by 9 points using a 9-point calibration algorithm. This 9-point calibration algorithm uses a set of known points to calibrate the intrinsic and extrinsic parameters of the visual system, thus determining the rotation and translation matrices of the visual system. Specifically, nine non-collinear points can be selected on the plane. Using the mapping relationship between the visual projections of these nine points and their real-world coordinates, a system of linear equations containing multiple unknowns can be established. Solving this system of equations yields the rotation and translation matrices of the visual system.
[0062] S203. Control the vision system to move above the preset magnet, obtain the first preset position of the horizontal and vertical axes when the vision system is measuring, and determine the second preset position of the magnet center of the preset magnet in the vision system; wherein, the preset magnet is fixed on the detection device.
[0063] In this embodiment, a square, pre-selected magnet with axial magnetization and uniform magnetic flux distribution can be used. This pre-selected magnet is fixed to the detection device, and its position is used for the calibration of the vision system, laser displacement sensor, and three-dimensional magnetic field camera. It should be noted that the position of the pre-selected magnet on the detection device is the same as its position on the detection device during the measurement of the target magnet.
[0064] Next, the vision system is controlled to move above the preset magnet, and the first preset position Pv1(Vx1,Vy1) of the horizontal and vertical axes when the vision system is measuring is recorded. At the same time, the second preset position Pv2(Vx2,Vy2) of the magnet center of the preset magnet in the vision system is calculated.
[0065] Optionally, calculating the second preset position of the magnet center of the preset magnet in the vision system may include: taking an image of the preset magnet through the vision system, cropping the magnet area from the image, determining the centroid of the magnet area, and using the centroid as the second preset position of the magnet center of the preset magnet in the vision system.
[0066] S205. Control the laser displacement sensor to move to the center position of the preset magnet, and obtain the third preset position of the horizontal and vertical axes, the fourth preset position of the vertical axis, and the preset reading value of the laser displacement sensor when it is measuring.
[0067] Next, control the laser displacement sensor to move to the center position of the preset magnet, and record the third preset position Pl1 (Lx1, Ly1) of the horizontal axis and the vertical axis located by the laser position sensor at this time, the fourth preset position (Lz1) of the vertical axis, and the preset reading value Lv1 of the laser displacement sensor.
[0068] The preset reading of the laser displacement sensor may include the distance from the upper surface of the preset magnet to the position of the laser displacement sensor's light outlet.
[0069] S207. Control the three-dimensional magnetic field camera to move above the preset magnet, and obtain the fifth preset position of the horizontal and vertical axes, the sixth preset position of the vertical axis, and the preset measurement gap of the three-dimensional magnetic field camera during measurement.
[0070] In this embodiment, a three-dimensional magnetic field camera can be moved above a preset magnet to record the fifth preset position Ps1(Sx1,Sy1) of the horizontal and vertical axes, the sixth preset position (Sz) of the vertical axis, and the current preset measurement gap (Sg) of the three-dimensional magnetic field camera during operation. The preset measurement gap refers to the distance from the upper surface of the preset magnet to the measurement surface of the three-dimensional magnetic field camera.
[0071] S209. Based on the three-dimensional magnetic field camera, acquire preset magnetic flux data and determine the seventh preset position of the magnet center of the preset magnet in the three-dimensional magnetic field camera.
[0072] In this embodiment, a three-dimensional magnetic field camera can be controlled to read current preset magnetic flux data and calculate the seventh preset position of the magnet center of the preset magnet in the three-dimensional magnetic field camera. Calculating the seventh preset position of the magnet center of the preset magnet in the three-dimensional magnetic field camera may include: capturing an image of the preset magnet using the three-dimensional magnetic field camera, cropping the magnet region from the image, determining the centroid of the magnet region, and using this centroid as the seventh preset position Pv(Sx,Sy) of the magnet center of the preset magnet in the three-dimensional magnetic field camera.
[0073] S2011. Set the correspondence between the sum of the third preset position and the first fixed deviation, and the sum of the first preset position and the second preset position to obtain the first positional relationship; set the correspondence between the sixth preset position, the preset measurement gap, the sum of the second fixed deviation, and the sum of the fourth preset position and the preset reading value to obtain the second positional relationship; set the correspondence between the fifth preset position, the seventh preset position, the sum of the third fixed deviation, and the sum of the first preset position and the second preset position to obtain the third positional relationship.
[0074] Optionally, regarding the first positional relationship: a correspondence can be established between the sum of a third preset position and a first fixed deviation, and the sum of the first preset position and the second preset position, to obtain the first positional relationship. Since the first preset position includes horizontal and vertical axis positions, the second preset position also includes horizontal and vertical axis positions, and the third preset position also includes horizontal and vertical axis positions, a correspondence can be established between the sum of the horizontal axis position (Lx1) in the third preset position and the first fixed deviation (LVΔX) corresponding to the horizontal axis, and the sum of the horizontal axis position (Vx1) in the first preset position and the horizontal axis position (Vx2) in the second preset position, to obtain the first positional relationship corresponding to the horizontal axis; a correspondence can also be established between the sum of the vertical axis position (Ly1) in the third preset position and the sum of the first fixed deviation (LVΔY) corresponding to the vertical axis, and the sum of the vertical axis position (Vy1) in the first preset position and the vertical axis position (Vy2) in the second preset position, to obtain the first positional relationship corresponding to the vertical axis.
[0075] In one implementation, the sum of the third preset position and the first fixed deviation can be set to be equal to the sum of the first preset position and the second preset position to obtain the first positional relationship. Since the first preset position includes both horizontal and vertical axis positions, the second preset position also includes both horizontal and vertical axis positions, and the third preset position also includes both horizontal and vertical axis positions, the sum of the horizontal axis position in the third preset position and the corresponding first fixed deviation (LVΔX) can be set to be equal to the sum of the horizontal axis positions in the first and second preset positions to obtain the first positional relationship corresponding to the horizontal axis; similarly, the sum of the vertical axis position in the third preset position and the corresponding first fixed deviation (LVΔY) can be set to be equal to the sum of the vertical axis positions in the first and second preset positions to obtain the first positional relationship corresponding to the vertical axis. Specifically, the first positional relationship can be as follows: Lx1 + LVΔX = Vx1 + Vx2; Ly1 + LVΔY = Vy1 + Vy2.
[0076] In other embodiments, a weight can be set for the sum of the horizontal axis position and the corresponding first fixed deviation (LVΔX) in the third preset position, and the product of the weight and the sum can be calculated to obtain a first product. Similarly, a weight can be set for the sum of the horizontal axis positions in the first preset position and the second preset position, and the product of the weight and the sum can be calculated to obtain a second product. The first product is then set to equal the second product to obtain the first positional relationship. Simultaneously, a weight can be set for the sum of the vertical axis position and the corresponding first fixed deviation (LVΔY) in the third preset position, and the product of the weight and the sum can be calculated to obtain a third product. Likewise, a weight can be set for the sum of the vertical axis positions in the first preset position and the second preset position, and the product of the weight and the sum can be calculated to obtain a fourth product. The third product is then set to equal the fourth product to obtain the first positional relationship corresponding to the vertical axis.
[0077] Optionally, regarding the second positional relationship: a correspondence can be established between the sum of the sixth preset position (Sz), the preset measurement gap (Sg), and the second fixed deviation (ΔZ), and the sum of the fourth preset position (Lz1) and the preset reading value (Lv1) to obtain the second positional relationship. In one embodiment, the sum of the sixth preset position (Sz), the preset measurement gap (Sg), and the second fixed deviation (ΔZ) can be set to be equal to the sum of the fourth preset position (Lz1) and the preset reading value (Lv1) to obtain the second positional relationship. The specific calculation formula can be as follows: Sz + Sg + ΔZ = Lz1 + Lv1.
[0078] In another implementation, a weight can be set for the sum of the sixth preset position (Sz), the preset measurement gap (Sg), and the second fixed deviation (ΔZ), and the product of the weight and the sum can be calculated to obtain the fifth product; a weight can be set for the sum of the fourth preset position (Lz1) and the preset reading value (Lv1), and the product of the weight and the sum can be calculated to obtain the sixth product, and the fifth product can be set to be equal to the sixth product to obtain the second positional relationship.
[0079] Optionally, for the third positional relationship: the correspondence between the sum of the fifth preset position Ps1(Sx1,Sy1), the seventh preset position Pv(Sx,Sy) and the third fixed deviation, and the sum of the first preset position Pv1(Vx1,Vy1) and the second preset position Pv2(Vx2,Vy2) can be set to obtain the third positional relationship.
[0080] Since the fifth preset position, the seventh preset position, the first preset position, and the second preset position all include horizontal and vertical axis positions, the correspondence between the sum of the horizontal axis positions in the fifth preset position and the seventh preset position and the corresponding third fixed deviation (LSΔX) can be set with the sum of the horizontal axis positions in the first preset position and the second preset position to obtain the third positional relationship corresponding to the horizontal axis; the correspondence between the sum of the vertical axis positions in the fifth preset position and the seventh preset position and the corresponding third fixed deviation (LSΔY) can be set with the sum of the vertical axis positions in the first preset position and the second preset position to obtain the third positional relationship corresponding to the vertical axis.
[0081] In one implementation, the sum of the fifth preset position Ps1(Sx1,Sy1), the seventh preset position Pv(Sx,Sy), and the third fixed deviation can be set to be equal to the sum of the first preset position Pv1(Vx1,Vy1) and the second preset position Pv2(Vx2,Vy2). Since the fifth preset position, the seventh preset position, the first preset position, and the second preset position all include horizontal and vertical axis positions, the sum of the horizontal axis position in the fifth preset position, the horizontal axis position in the seventh preset position, and the corresponding third fixed deviation (LSΔX) can be set to be equal to the sum of the horizontal axis position in the first preset position and the horizontal axis position in the second preset position, thus obtaining the third positional relationship corresponding to the horizontal axis; and the sum of the vertical axis position in the fifth preset position, the vertical axis position in the seventh preset position, and the corresponding third fixed deviation (LSΔY) can be set to be equal to the sum of the vertical axis position in the first preset position and the vertical axis position in the second preset position, thus obtaining the third positional relationship corresponding to the vertical axis. Accordingly, the third positional relationship can be as follows: Sx1+Sx+LSΔX=Vx1+Vx2; Sy1+Sy+LSΔY=Vy1+Vy2;
[0082] In other embodiments, a weight can be set for the sum of the horizontal axis position in the fifth preset position, the horizontal axis position in the seventh preset position, and the corresponding third fixed deviation (LSΔX). The product of the weight and the sum is calculated to obtain a seventh product. A weight can also be set for the sum of the horizontal axis positions in the first preset position and the second preset position. The product of the weight and the sum is calculated to obtain an eighth product. The seventh product is set to equal the eighth product to obtain the third positional relationship. Simultaneously, a weight can be set for the sum of the vertical axis position in the fifth preset position, the vertical axis position in the seventh preset position, and the corresponding third fixed deviation (LSΔY). The product of the weight and the sum is calculated to obtain a ninth product. A weight can also be set for the sum of the vertical axis positions in the first preset position and the second preset position. The product of the weight and the sum is calculated to obtain a tenth product. The ninth product is set to equal the tenth product to obtain the third positional relationship corresponding to the vertical axis.
[0083] In this embodiment, the first, second, and third positional relationships are accurately pre-calibrated during the calibration process. This allows for accurate positioning of the three-dimensional magnetic field camera's measurement position and height during subsequent measurements, enabling the calibrated camera to acquire magnetic flux data from all points within its field of view in a single measurement, thus improving measurement efficiency and detection accuracy. Furthermore, setting the sum of the third preset position and the first fixed deviation to equal the sum of the first preset position and the second preset position improves the calibration accuracy of the first positional relationship. Setting the sum of the sixth preset position, the preset measurement gap, and the second fixed deviation to equal the sum of the fourth preset position and the preset reading improves the calibration accuracy of the second positional relationship. Setting the sum of the fifth preset position, the seventh preset position, and the third fixed deviation to equal the sum of the first preset position and the second preset position improves the calibration accuracy of the third positional relationship.
[0084] In an optional embodiment, in step S209 above, the acquisition of preset magnetic flux data based on the three-dimensional magnetic field camera and the determination of the seventh preset position of the magnet center of the preset magnet in the three-dimensional magnetic field camera include: determining the first initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera.
[0085] Rotate the preset magnet by 90° to determine the second initial position of the magnet center in the three-dimensional magnetic field camera.
[0086] Continue rotating the preset magnet by 90° to determine the third initial position of the magnet center in the three-dimensional magnetic field camera.
[0087] Continue rotating the preset magnet by 90° to determine the fourth initial position of the magnet center in the three-dimensional magnetic field camera.
[0088] The average value of the first initial position, the second initial position, the third initial position, and the fourth initial position is determined to obtain the seventh preset position.
[0089] In this embodiment, the first initial position Pv1(SVx1,SVy1) of the center of the preset magnet in the three-dimensional magnetic field camera can be calculated first. The preset magnet is rotated 90° to determine the second initial position Pv2(SVx2,SVy2) of the center of the preset magnet in the three-dimensional magnetic field camera. The magnet is then rotated another 90° to determine the third initial position Pv3(SVx3,SVy3) of the center of the preset magnet in the three-dimensional magnetic field camera. Finally, the magnet is rotated another 90° to determine the fourth initial position Pv4(SVx4,SVy4) of the center of the preset magnet in the three-dimensional magnetic field camera. Finally, the average or weighted average of the first, second, third, and fourth initial positions is calculated to obtain the seventh preset position Pv(Sx,Sy). Taking the average value as an example, the calculation formula can be as follows: Pv(Sx,Sy)=((SVx1+SVx2+SVx3+SVx4) / 4,(SVy1+SVy2+SVy3+SVy4) / 4).
[0090] Optionally, determining the first initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera may include: capturing an image of the preset magnet using the three-dimensional magnetic field camera, cropping the magnet region from the image, determining the centroid of the magnet region, and using this centroid as the first initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera. The calculation methods for the second, third, and fourth initial positions are the same as those for the first initial position.
[0091] Since the preset magnet is axially magnetized, but there may be slight deviations during magnetization, four initial positions are obtained by rotating it 90 degrees in the above manner, and the average of these four initial positions is taken to obtain the seventh preset position. This can improve the accuracy of determining the seventh preset position of the magnet center of the preset magnet in the three-dimensional magnetic field camera, thereby improving the calibration accuracy and thus improving the magnetic flux detection accuracy.
[0092] It should be noted that step S103 above can be implemented in a variety of ways, and no specific limitation is made.
[0093] Figure 4 is a flowchart illustrating a method for determining the fourth position of the horizontal and vertical axes during laser displacement sensor measurement, according to an embodiment of this application. As shown in Figure 4, in one embodiment, determining the fourth position of the horizontal and vertical axes during laser displacement sensor measurement based on the first positional relationship between laser and vision, the first position, the second position, and the third position may include: S1031. Obtaining a pre-calibrated first positional relationship; the first positional relationship is used to characterize the correspondence between the sum of the first positions and the sum of the second positions, the first position sum being the sum of the position of the horizontal and vertical axes during laser displacement sensor measurement and a first fixed deviation, and the second position sum being the sum of the position of the horizontal and vertical axes during vision system measurement and the position of the magnet center in the vision system.
[0094] S1033. Based on the first positional relationship, determine the fourth position as the difference between the first target position and the first fixed deviation; wherein, the first target position is determined based on the first position, the second position and the third position.
[0095] In this embodiment, a pre-calibrated first positional relationship can be obtained. This first positional relationship characterizes the correspondence between a first sum of positions and a second sum of positions. The first sum of positions is the sum of the positions of the horizontal and vertical axes measured by the laser displacement sensor and a first fixed deviation. The second sum of positions is the sum of the positions of the horizontal and vertical axes measured by the vision system and the position of the magnet center in the vision system. More specifically, this first positional relationship can be used to characterize that the first sum of positions equals the second sum of positions.
[0096] Based on this first positional relationship, the fourth position (LX1, LY1) can be determined as the difference between the first target position and the first fixed deviation. In one embodiment, the first target position is the sum of the first position PM(Mx1, My1), the second position PV1(VX1, VY1), and the third position PV2(VX2, VY2). In other embodiments, the first target position can be obtained by assigning different weights to the first, second, and third positions.
[0097] Taking the first target position as the sum of the first, second, and third positions as an example, the horizontal axis position of the fourth position (LX1, LY1) can be the difference between the sum of the horizontal axis positions of the first position PM (Mx1, My1), the second position PV1 (VX1, VY1), and the third position PV2 (VX2, VY2) and the first fixed deviation (LVΔX) of the horizontal axis. Similarly, the vertical axis position of the fourth position (LX1, LY1) can be the difference between the sum of the vertical axis positions of the first position PM (Mx1, My1), the second position PV1 (VX1, VY1), and the third position PV2 (VX2, VY2) and the first fixed deviation (LVΔY) of the vertical axis. The specific calculation formulas are as follows: LX1 = VX1 + VX2 - LVΔX + Mx1; LY1 = VY1 + VY2 - LVΔY + My1.
[0098] Since the first positional relationship is used to characterize the correspondence between the sum of the positions of the horizontal and vertical axes of the laser displacement sensor during measurement and the first fixed deviation, and the sum of the positions of the horizontal and vertical axes of the vision system during measurement and the position of the magnet center in the vision system, and since the second and third positions are features associated with the vision system, and the first position is the position of the target magnet relative to the reference point in the product under test, therefore, based on the pre-calibrated first positional relationship, combined with the first, second, and third positions, the fourth position of the horizontal and vertical axes of the laser displacement sensor during measurement can be accurately determined, improving the position determination accuracy of the laser displacement sensor during measurement, thereby improving the position determination accuracy of the three-dimensional magnetic field camera during measurement, and further improving the detection accuracy of the target magnetic flux data.
[0099] It should be noted that step S107 above can be implemented in a variety of ways, and no specific limitation is made.
[0100] Figure 5 is a flowchart illustrating the process of determining the vertical axis position during measurement by a three-dimensional magnetic field camera according to an embodiment of this application. As shown in Figure 5, in an optional embodiment, in step S107 above, determining the vertical axis position during measurement by the three-dimensional magnetic field camera based on the second positional relationship between the three-dimensional magnetic field camera and the laser, the fifth position, the target reading, and the target measurement gap includes: S1071. Obtaining a pre-calibrated second positional relationship; the second positional relationship is used to characterize the correspondence between the third position sum and the fourth position sum, the third position sum being the sum of the vertical axis position, the measurement gap, and the second fixed deviation during measurement by the three-dimensional magnetic field camera, and the fourth position sum being the sum of the position of the vertical axis measured by the laser displacement sensor and the reading of the laser displacement sensor.
[0101] S1073. Based on the second positional relationship, determine that the vertical axis position of the three-dimensional magnetic field camera during measurement is equal to the difference between the second target position and the third target position; wherein, the second target position is determined based on the fifth position and the target reading, and the third target position is determined based on the second fixed deviation and the target measurement gap.
[0102] In this embodiment, a pre-defined second positional relationship can be obtained, which is used to characterize the correspondence between the sum of the third position and the sum of the fourth position. More specifically, the second positional relationship can be used to indicate that the sum of the third position equals the sum of the fourth position.
[0103] Based on this second positional relationship, the vertical axis position (SZ) of the three-dimensional magnetic field camera during measurement can be determined to be equal to the difference between the second target position and the third target position. The second target position is determined based on the fifth position (LZ1) and the target reading (LV1), and the third target position is determined based on the second fixed deviation (ΔZ) and the target measurement gap (SG). In one embodiment, the second target position is the sum of the fifth position (LZ1) and the target reading (LV1), and the third target position is the sum of the second fixed deviation (ΔZ) and the target measurement gap (SG). In other embodiments, the second target position can be obtained by assigning different weights to the fifth position (LZ1) and the target reading (LV1), and the third target position can be obtained by assigning different weights to the second fixed deviation (ΔZ) and the target measurement gap (SG).
[0104] Taking the second target position as the sum of the fifth position (LZ1) and the target reading (LV1), and the third target position as the sum of the second fixed deviation (ΔZ) and the target measurement gap (SG), the vertical axis position (SZ) of the three-dimensional magnetic field camera during measurement can be the difference between the sum of the fifth position (LZ1) and the target reading (LV1), and the sum of the second fixed deviation (ΔZ) and the target measurement gap (SG). The specific calculation formula is as follows: SZ = LZ1 + LV1 - ΔZ - SG.
[0105] Since the second positional relationship is used to characterize the correspondence between the sum of the third position and the sum of the fourth position, and since the fifth position, the target reading, and the target measurement gap are all features associated with the laser displacement sensor, the vertical axis position during the measurement of the three-dimensional magnetic field camera can be obtained quickly and accurately based on the second positional relationship and the aforementioned features associated with the laser displacement sensor, thereby improving the position determination accuracy during the measurement of the three-dimensional magnetic field camera and thus improving the detection accuracy of the target magnetic flux data.
[0106] It should be noted that step S109 can be implemented in various ways, and no specific limitation is made.
[0107] Figure 6 is a flowchart illustrating the determination of the horizontal and vertical axis positions during a three-dimensional magnetic field camera measurement according to an embodiment of this application. As shown in Figure 6, in one embodiment, in step S109 above, the determination of the horizontal and vertical axis positions during a three-dimensional magnetic field camera measurement based on the third positional relationship between the three-dimensional magnetic field camera and vision, the first position, the second position, and the third position, includes: S1091. Obtaining the pre-calibrated third positional relationship.
[0108] S1093. Based on the third positional relationship, the position of the horizontal and vertical axes when the three-dimensional magnetic field camera performs measurement is determined as the difference between the fourth target position and the fifth target position; wherein, the fourth target position is determined based on the first position, the second position and the third position, and the fifth target position is determined based on the third fixed deviation and the position of the magnet center in the three-dimensional magnetic field camera.
[0109] In this embodiment, a pre-defined third positional relationship can be obtained, which is used to characterize the correspondence between the sum of the fifth position and the sum of the sixth position. More specifically, the third positional relationship can be used to characterize that the sum of the fifth position equals the sum of the sixth position.
[0110] Based on this third positional relationship, the position (SX, SY) of the horizontal and vertical axes during the measurement by the three-dimensional magnetic field camera can be determined as the difference between the fourth and fifth target positions. In one embodiment, the fourth target position is the sum of the first position PM (Mx1, My1), the second position PV1 (VX1, VY1), and the third position PV2 (VX2, VY2), and the fifth target position is the sum of the third fixed deviation and the position of the magnet center in the three-dimensional magnetic field camera. In other embodiments, the fourth target position can be obtained by assigning different weights to the first position PM (Mx1, My1), the second position PV1 (VX1, VY1), and the third position PV2 (VX2, VY2), and the fifth target position can be obtained by assigning different weights to the third fixed deviation and the position of the magnet center in the three-dimensional magnetic field camera.
[0111] Taking the fourth target position as the sum of the first position PM(Mx1,My1), the second position PV1(VX1,VY1), and the third position PV2(VX2,VY2), and the fifth target position as the sum of the third fixed deviation and the position of the magnet center in the three-dimensional magnetic field camera, the horizontal axis position (SX, SY) of the three-dimensional magnetic field camera during measurement can be the first position PM(Mx1,My1), the second position PV1(VX1,VY1), and the third position PV2(VX2,VY2). The sum of the horizontal axis positions, and the difference between the sum of the third fixed deviation of the horizontal axis (LSΔX) and the sum of the positions of the magnet center in the three-dimensional magnetic field camera, are used to calculate the vertical axis position (SX, SY) of the horizontal and vertical axes during measurement. The vertical axis position can be the sum of the vertical axis positions of the first position PM (Mx1, My1), the second position PV1 (VX1, VY1), and the third position PV2 (VX2, VY2), and the difference between the sum of the vertical axis positions, the third fixed deviation of the vertical axis (LSΔY), and the sum of the positions of the magnet center in the three-dimensional magnetic field camera. The specific calculation formulas are as follows: SX = VX1 + VX2 - LSΔX - 6.4 + Mx1; SY = VY1 + VY2 - LSΔY - 6.4 + My1.
[0112] The center of the magnet is located at 6.4 in the three-dimensional magnetic field camera.
[0113] Since the third positional relationship is used to characterize the correspondence between the sum of the fifth and sixth positions, and since the first, second, and third positions are all parameters associated with the vision system, the position of the 3D magnetic field camera during measurement can be obtained quickly and accurately based on this third positional relationship and the aforementioned parameters associated with the vision system. Furthermore, since the vision system can locate the measurement position of the 3D magnetic field camera, the horizontal and vertical axis positions during measurement can be obtained quickly and accurately based on this third positional relationship and the aforementioned parameters associated with the vision system, thereby improving the position determination accuracy of the 3D magnetic field camera and consequently improving the detection accuracy of the target magnetic flux data.
[0114] In an optional embodiment, after the three-dimensional magnetic field camera acquires target magnetic flux data at the horizontal and vertical axis positions, the method further includes: converting the target magnetic flux data into a magnetic field thermogram.
[0115] Connect the magnetic flux data that meet the preset conditions in the magnetic field thermogram to obtain the connected components.
[0116] The magnetic flux data in the connected domain that is greater than the magnetic field data threshold is taken as the magnetic field peak value, and the average value of all magnetic flux data in the connected domain is taken as the position data of the target magnet.
[0117] In this embodiment, the target magnetic flux data can be converted into a magnetic field heatmap. Connectivity analysis of the heatmap is then performed to obtain the magnetic field peak value and location data. Specifically, magnetic flux data that meet preset conditions in the heatmap can be connected to obtain the connected components of the target magnet. These magnetic flux data can be identical or greater than a certain threshold. Next, the magnetic flux data in the connected component that exceeds the magnetic field data threshold is taken as the magnetic field peak value of the target magnet. This threshold value can refer to the maximum magnetic flux value. Simultaneously, the average value of the magnetic flux data in the connected component is taken as the location data of the target magnet. For example, the average value of the magnetic flux data in the connected component that meets a certain threshold condition can be calculated to obtain the location data of the target magnet.
[0118] Therefore, a three-dimensional magnetic field camera can collect magnetic flux values of all points within the field of view at once and convert them into a planar heat map, which provides a more intuitive view of the distribution of magnetic flux. After performing connected domain analysis on the heat map, the peak value and two-dimensional position of the magnetic flux can be obtained quickly and accurately, which more precisely represents the actual peak value and position of the magnetic flux.
[0119] In an optional embodiment, the method further includes: acquiring at least one scan line segment passing through the target magnet on the magnetic field thermogram.
[0120] Obtain the magnetic flux data located on at least one scan line segment from the target magnetic flux data.
[0121] The magnetic flux data located on the at least one scan line segment are analyzed to obtain the magnetic field peak value and magnetic pole width of the at least one scan line segment.
[0122] In this embodiment, at least one scan line segment passing through the target magnet can be plotted on the magnetic flux heatmap. Magnetic flux data located on the at least one scan line segment is acquired. The magnetic flux data on each scan line segment is analyzed, and the maximum magnetic flux data on each scan line segment is taken as the magnetic field peak value of each scan line segment. A magnetic field threshold is defined based on this magnetic field peak value. The magnetic field strength is searched outwards from the magnetic field peak value to find the point where the magnetic field strength first falls below the magnetic field threshold value, obtaining two boundary points. The distance between these two boundary points is taken as the magnetic pole width on the scan line segment. Thus, by plotting scan lines on the magnetic flux heatmap and analyzing the data, the magnetic pole width and magnetic field peak value at multiple locations can be obtained accurately, quickly, and effectively.
[0123] In other implementations, data acquired multiple times by a mobile 3D magnetic field camera can be stitched together to form a large magnetic field distribution map. After being converted into an image, visual analysis can be performed to obtain magnet characteristics, such as the radius of the magnetic poles and the center of the magnetic poles of a circular magnet.
[0124] It should be noted that, since this application can perform the above steps S101-S1011 for different target magnets, the target magnetic flux data corresponding to different target magnets can be obtained. Therefore, for different target magnets, their magnetic field peak, position data and magnetic pole width can be calculated in the above manner.
[0125] The following is an overall description of the above magnetic flux detection process: Calibration process: 1) Visual calibration is performed by moving 9 points.
[0126] 2) Take a square pre-set magnet with axial magnetization and uniform magnetic flux distribution, fix it on the detection equipment, and use the pre-set magnet to calibrate the position of the vision system, laser displacement sensor and three-dimensional magnetic field camera.
[0127] 3) Control the vision system to move above the preset magnet, obtain the first preset position of the horizontal and vertical axes when the vision system is measuring, and determine the second preset position of the magnet center of the preset magnet in the vision system.
[0128] 4) Control the laser displacement sensor to move to the center position of the preset magnet, and obtain the third preset position of the horizontal and vertical axes, the fourth preset position of the vertical axis, and the preset reading value of the laser displacement sensor when measuring.
[0129] 5) Control the three-dimensional magnetic field camera to move above the preset magnet, and obtain the fifth preset position of the horizontal and vertical axes, the sixth preset position of the vertical axis, and the preset measurement gap of the three-dimensional magnetic field camera during measurement.
[0130] 6) Based on the three-dimensional magnetic field camera, acquire preset magnetic flux data and determine the seventh preset position of the magnet center of the preset magnet in the three-dimensional magnetic field camera.
[0131] 7) Set the sum of the third preset position and the first fixed deviation to be equal to the sum of the first preset position and the second preset position to obtain the first positional relationship; set the sum of the sixth preset position, the preset measurement gap and the second fixed deviation to be equal to the sum of the fourth preset position and the preset reading value to obtain the second positional relationship; set the sum of the fifth preset position, the seventh preset position and the third fixed deviation to be equal to the sum of the first preset position and the second preset position to obtain the third positional relationship.
[0132] Detection process: 1) Obtain the reference point of the product under test based on the vision system; determine the first position of the target magnet relative to the reference point in the product under test, the second position of the horizontal and vertical axes when the vision system measures, and the third position of the magnet center of the target magnet relative to the reference point in the vision system.
[0133] 2) Based on the first positional relationship between laser and vision, the first position, the second position, and the third position, determine the fourth position of the horizontal and vertical axes when the laser displacement sensor is measuring.
[0134] 3) Control the laser displacement sensor to move to the fourth position, and obtain the fifth position where the vertical axis is located and the target reading value of the laser displacement sensor.
[0135] 4) Based on the second positional relationship between the three-dimensional magnetic field camera and the laser, the fifth position, the target reading and the target measurement gap, determine the vertical axis position of the three-dimensional magnetic field camera during measurement.
[0136] 5) Based on the third positional relationship between the three-dimensional magnetic field camera and vision, the first position, the second position, and the third position are used to determine the horizontal and vertical axis positions of the three-dimensional magnetic field camera during measurement.
[0137] 6) Control the three-dimensional magnetic field camera to acquire target magnetic flux data at the horizontal and vertical axis positions.
[0138] 7) Repeat steps 1)-6) in the above detection process to obtain the target magnetic flux data of multiple target magnets.
[0139] 8) The magnetic field data obtained above can be converted into a magnetic field heat map, which allows for a direct observation of the magnetic field distribution.
[0140] 9) Convert the target magnetic flux data into a magnetic field heat map; connect the magnetic flux data in the magnetic field heat map that meet the preset conditions to obtain a connected region; take the magnetic flux data in the connected region that is greater than the magnetic field data threshold as the magnetic field peak value, and take the average value of the magnetic flux data in the connected region as the position data of the target magnet.
[0141] 10) Obtain at least one scan line segment passing through the target magnet on the magnetic field thermogram; obtain magnetic flux data located on the at least one scan line segment from the target magnetic flux data; analyze the magnetic flux data located on the at least one scan line segment to obtain the magnetic field peak value and magnetic pole width of the at least one scan line segment.
[0142] Figure 7 is a structural block diagram of a magnetic flux detection device provided in an embodiment of this application. The magnetic flux detection device is applied to a detection equipment, which includes a vision system, a three-dimensional magnetic field camera, a laser displacement sensor, a horizontal axis, a vertical axis, and a cross axis. A product to be tested is fixed on the detection equipment. As shown in Figure 7, the device includes: a first determining module 301, used to acquire a reference point of the product to be tested based on the vision system; determine a first position of the target magnet relative to the reference point in the product to be tested, a second position of the horizontal and vertical axes when measured by the vision system, and a third position of the magnet center of the target magnet relative to the reference point in the vision system; a first laser positioning module 303, used to determine a fourth position of the horizontal and vertical axes when measured by the laser displacement sensor based on a first positional relationship between the laser and the vision, the first position, the second position, and the third position; and a second laser positioning module 305, used to control the laser displacement sensor to move to the fourth position, acquire a fifth position of the vertical axis, and the target reading of the laser displacement sensor. The first camera positioning module 307 is used to determine the vertical axis position of the three-dimensional magnetic field camera during measurement based on the second positional relationship between the three-dimensional magnetic field camera and the laser, the fifth position, the target reading, and the target measurement gap; the second camera positioning module 309 is used to determine the horizontal and vertical axis positions of the three-dimensional magnetic field camera during measurement based on the third positional relationship between the three-dimensional magnetic field camera and the vision, the first position, the second position, and the third position; the magnetic flux acquisition module 3011 is used to control the three-dimensional magnetic field camera to acquire target magnetic flux data at the horizontal and vertical axis positions.
[0143] In an optional embodiment, the first laser positioning module includes: a first position relationship acquisition module, configured to acquire a pre-calibrated first position relationship; the first position relationship is used to characterize the correspondence between a first position sum and a second position sum, wherein the first position sum is the sum of the positions of the horizontal and vertical axes measured by the laser displacement sensor and a first fixed deviation, and the second position sum is the sum of the positions of the horizontal and vertical axes measured by the vision system and the position of the magnet center in the vision system; and a first difference determination module, configured to determine, based on the first position relationship, the fourth position as the difference between the first target position and the first fixed deviation; wherein the first target position is determined based on the first position, the second position, and the third position.
[0144] In an optional embodiment, the first camera positioning module includes: a second position relationship acquisition module, configured to acquire a pre-calibrated second position relationship; the second position relationship is used to characterize the correspondence between a third position sum and a fourth position sum, wherein the third position sum is the sum of the vertical axis position, measurement gap, and second fixed deviation during measurement by the three-dimensional magnetic field camera, and the fourth position sum is the sum of the position of the vertical axis measured by the laser displacement sensor and the reading of the laser displacement sensor; and a second difference determination module, configured to determine, based on the second position relationship, that the vertical axis position during measurement by the three-dimensional magnetic field camera is equal to the difference between a second target position and a third target position; wherein the second target position is determined based on the fifth position and the target reading, and the third target position is determined based on the second fixed deviation and the target measurement gap.
[0145] In an optional embodiment, the second camera positioning module includes: a third position relationship acquisition module, configured to acquire a pre-calibrated third position relationship; the third position relationship is used to characterize the correspondence between the sum of the fifth position and the sum of the sixth position, wherein the sum of the fifth position is the sum of the horizontal and vertical axis positions when the three-dimensional magnetic field camera is measuring, the position of the magnet center in the three-dimensional magnetic field camera, and the third fixed deviation, and the sum of the sixth position is the sum of the positions of the horizontal and vertical axes when the vision system is measuring, and the position of the magnet center in the vision system; and a third difference determination module, configured to determine, based on the third position relationship, the difference between the positions of the horizontal and vertical axes when the three-dimensional magnetic field camera is measuring and the fourth target position and the fifth target position; wherein the fourth target position is determined based on the first position, the second position, and the third position, and the fifth target position is determined based on the third fixed deviation and the position of the magnet center in the three-dimensional magnetic field camera.
[0146] In an optional embodiment, the device further includes: a vision system calibration module for calibrating the vision system; a first movement module for controlling the vision system to move above a preset magnet, acquiring a first preset position of the horizontal and vertical axes during measurement by the vision system, and determining a second preset position of the magnet center of the preset magnet in the vision system; wherein the preset magnet is fixed on the detection device; a second movement module for controlling the laser displacement sensor to move to the center position of the preset magnet, acquiring a third preset position of the horizontal and vertical axes during measurement by the laser displacement sensor, a fourth preset position of the vertical axis, and a preset reading of the laser displacement sensor; a third movement module for controlling the three-dimensional magnetic field camera to move above the preset magnet, acquiring a fifth preset position of the horizontal and vertical axes during measurement by the three-dimensional magnetic field camera, a sixth preset position of the vertical axis, and a preset measurement gap of the three-dimensional magnetic field camera; and a position determination module for acquiring preset magnetic flux data based on the three-dimensional magnetic field camera, and determining a seventh preset position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; The positional relationship determination module is used to set the correspondence between the sum of the third preset position and the first fixed deviation, and the sum of the first preset position and the second preset position, to obtain the first positional relationship; set the correspondence between the sum of the sixth preset position, the preset measurement gap, the second fixed deviation, and the sum of the fourth preset position and the preset reading value, to obtain the second positional relationship; and set the correspondence between the fifth preset position, the seventh preset position, the sum of the third fixed deviation, and the sum of the first preset position and the second preset position, to obtain the third positional relationship.
[0147] In an optional embodiment, the positional relationship determination module includes: a first positional relationship determination unit, configured to set the sum of the third preset position and the first fixed deviation to be equal to the sum of the first preset position and the second preset position, thereby obtaining the first positional relationship; a second positional relationship determination unit, configured to set the sum of the sixth preset position, the preset measurement gap, and the second fixed deviation to be equal to the sum of the fourth preset position and the preset reading value, thereby obtaining the second positional relationship; and a third positional relationship determination unit, configured to set the sum of the fifth preset position, the seventh preset position, and the third fixed deviation to be equal to the sum of the first preset position and the second preset position, thereby obtaining the third positional relationship.
[0148] In an optional embodiment, the position determination module includes: a first initial position determination unit, configured to determine a first initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; a second initial position determination unit, configured to rotate the preset magnet by 90° to determine a second initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; a third initial position determination unit, configured to continue rotating the preset magnet by 90° to determine a third initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; a fourth initial position determination unit, configured to continue rotating the preset magnet by 90° to determine a fourth initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; and a seventh preset position determination unit, configured to determine the average of the first, second, third, and fourth initial positions to obtain the seventh preset position.
[0149] In an optional embodiment, the device further includes: a conversion module for converting the target magnetic flux data into a magnetic field heatmap; a connected component determination module for connecting magnetic flux data in the magnetic field heatmap that meet preset conditions to obtain a connected component; and a peak position determination module for taking magnetic flux data in the connected component that are greater than a magnetic field data threshold as the magnetic field peak value, and taking the average value of all magnetic flux data in the connected component as the position data of the target magnet.
[0150] In an optional embodiment, the apparatus further includes: a scan segment generation module, configured to acquire at least one scan segment passing through the target magnet on the magnetic field thermogram; a scan segment data acquisition module, configured to acquire magnetic flux data located on the at least one scan segment from the target magnetic flux data; and a peak width determination module, configured to analyze the magnetic flux data located on the at least one scan segment to obtain the magnetic field peak value and magnetic pole width of the at least one scan segment.
[0151] The apparatus and method embodiments described herein are based on the same inventive concept.
[0152] This application provides an electronic device including a processor and a memory. The memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement the magnetic flux detection method provided in the above method embodiments.
[0153] Embodiments of the present invention also provide a computer storage medium, which can be disposed in a terminal to store at least one instruction or at least one program related to implementing a magnetic flux detection method in the method embodiments. The at least one instruction or at least one program is loaded and executed by the processor to implement the magnetic flux detection method provided in the above method embodiments.
[0154] Embodiments of the present invention also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the magnetic flux detection method provided in the above-described method embodiments.
[0155] Optionally, in the embodiments of this specification, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0156] The memory described in the embodiments of this specification can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for the functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.
[0157] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments of this specification have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0158] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0159] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer storage medium, such as a read-only memory, a disk, or an optical disk.
[0160] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A magnetic flux detection method characterized by, The magnetic flux detection method is applied to a detection device, which includes a vision system, a three-dimensional magnetic field camera, a laser displacement sensor, a horizontal axis, a vertical axis, and a horizontal axis. The product to be tested is fixed on the detection device. The magnetic flux detection method includes: The reference point of the product under test is obtained based on the vision system; the first position of the target magnet in the product under test relative to the reference point, the second position of the horizontal and vertical axes when the vision system measures, and the third position of the magnet center of the target magnet relative to the reference point in the vision system are determined. Based on the first positional relationship between laser and vision, the first position, the second position, and the third position, the fourth position of the horizontal and vertical axes when the laser displacement sensor is measuring is determined; Control the laser displacement sensor to move to the fourth position, and obtain the fifth position where the vertical axis is located and the target reading value of the laser displacement sensor; Based on the second positional relationship between the three-dimensional magnetic field camera and the laser, the fifth position, the target reading, and the target measurement gap, the vertical axis position of the three-dimensional magnetic field camera during measurement is determined. Based on the third positional relationship between the three-dimensional magnetic field camera and vision, the first position, the second position and the third position are used to determine the horizontal and vertical axis positions of the three-dimensional magnetic field camera during measurement. The three-dimensional magnetic field camera is controlled to acquire target magnetic flux data at the horizontal, vertical, and longitudinal axes.
2. The magnetic flux detection method according to claim 1, characterized in that, The determination of the fourth position of the horizontal and vertical axes during laser displacement sensor measurement, based on the first positional relationship between laser and vision, the first position, the second position, and the third position, includes: Obtain the pre-calibrated first positional relationship; the first positional relationship is used to characterize the correspondence between the first position sum and the second position sum, the first position sum is the sum of the position of the horizontal and vertical axes when measured by the laser displacement sensor and the first fixed deviation, and the second position sum is the sum of the position of the horizontal and vertical axes when measured by the vision system and the position of the magnet center in the vision system; Based on the first positional relationship, the fourth position is determined to be the difference between the first target position and the first fixed deviation; The first target position is determined based on the first position, the second position, and the third position.
3. The magnetic flux detection method according to claim 1, characterized in that, The determination of the vertical axis position of the three-dimensional magnetic field camera during measurement, based on the second positional relationship between the three-dimensional magnetic field camera and the laser, the fifth position, the target reading, and the target measurement gap, includes: Obtain the pre-calibrated second positional relationship; the second positional relationship is used to characterize the correspondence between the third position sum and the fourth position sum, the third position sum is the sum of the vertical axis position, measurement gap and second fixed deviation when the three-dimensional magnetic field camera is measuring, and the fourth position sum is the sum of the position of the vertical axis measured by the laser displacement sensor and the reading of the laser displacement sensor; Based on the second positional relationship, it is determined that the vertical axis position of the three-dimensional magnetic field camera during measurement is equal to the difference between the second target position and the third target position; The second target position is determined based on the fifth position and the target reading, and the third target position is determined based on the second fixed deviation and the target measurement gap.
4. The magnetic flux detection method of claim 1, wherein, The method for determining the horizontal and vertical axis positions of the three-dimensional magnetic field camera during measurement, based on the third positional relationship between the three-dimensional magnetic field camera and vision, and the first, second, and third positions, includes: Obtain the pre-calibrated third positional relationship; the third positional relationship is used to characterize the correspondence between the fifth position sum and the sixth position sum, the fifth position sum is the sum of the horizontal and vertical axis positions when the three-dimensional magnetic field camera is measuring, the position of the magnet center in the three-dimensional magnetic field camera, and the third fixed deviation, and the sixth position sum is the sum of the horizontal and vertical axis positions when the vision system is measuring, and the position of the magnet center in the vision system; Based on the third positional relationship, the position of the horizontal and vertical axes when the three-dimensional magnetic field camera performs the measurement is determined as the difference between the fourth target position and the fifth target position; The fourth target position is determined based on the first position, the second position, and the third position, and the fifth target position is determined based on the third fixed deviation and the position of the magnet center in the three-dimensional magnetic field camera.
5. The magnetic flux detection method according to claim 1, characterized in that, The method further includes: The vision system is calibrated; The vision system is controlled to move above a preset magnet, and the first preset position of the horizontal and vertical axes of the vision system during measurement is obtained, and the magnet center of the preset magnet is determined to be at a second preset position in the vision system; wherein the preset magnet is fixed on the detection device; Control the laser displacement sensor to move to the center position of the preset magnet, obtain the third preset position of the horizontal and vertical axes, the fourth preset position of the vertical axis, and the preset reading value of the laser displacement sensor when it is measuring. The three-dimensional magnetic field camera is controlled to move above the preset magnet, and the fifth preset position of the horizontal and vertical axes, the sixth preset position of the vertical axis, and the preset measurement gap of the three-dimensional magnetic field camera are obtained during the measurement. Based on the preset magnetic flux data obtained by the three-dimensional magnetic field camera, the magnet center of the preset magnet is determined to be at the seventh preset position in the three-dimensional magnetic field camera. The first positional relationship is obtained by setting the correspondence between the sum of the third preset position and the first fixed deviation, and the sum of the first preset position and the second preset position; the second positional relationship is obtained by setting the correspondence between the sixth preset position, the preset measurement gap, the sum of the second fixed deviation, and the sum of the fourth preset position and the preset reading value; the third positional relationship is obtained by setting the correspondence between the fifth preset position, the seventh preset position, the sum of the third fixed deviation, and the sum of the first preset position and the second preset position.
6. The magnetic flux detection method according to claim 5, characterized in that, The step of setting the sum of the third preset position and the first fixed deviation, and the correspondence between the first preset position and the sum of the second preset position, to obtain the first positional relationship, includes: The sum of the third preset position and the first fixed deviation is set to be equal to the sum of the first preset position and the second preset position, thus obtaining the first positional relationship; The second positional relationship is obtained by setting the correspondence between the sum of the sixth preset position, the preset measurement gap, and the second fixed deviation, and the sum of the fourth preset position and the preset reading value, including: The sum of the sixth preset position, the preset measurement gap, and the second fixed deviation is set to be equal to the sum of the fourth preset position and the preset reading value, thus obtaining the second positional relationship; The method of setting the sum of the fifth preset position, the seventh preset position, and the third fixed deviation, and the correspondence between the sum of the first preset position and the second preset position, to obtain the third position relationship, includes: The sum of the fifth preset position, the seventh preset position, and the third fixed deviation is set to be equal to the sum of the first preset position and the second preset position, thus obtaining the third positional relationship.
7. The magnetic flux detection method of claim 5, wherein, Determining the seventh preset position of the magnet center of the preset magnet in the three-dimensional magnetic field camera includes: Determine the first initial position of the magnet center of the preset magnet in the three-dimensional magnetic field camera; Rotate the preset magnet by 90° to determine the second initial position of the magnet center in the three-dimensional magnetic field camera; Continue to rotate the preset magnet by 90° to determine the third initial position of the magnet center in the three-dimensional magnetic field camera; Continue to rotate the preset magnet by 90° to determine the fourth initial position of the magnet center in the three-dimensional magnetic field camera; The average value of the first initial position, the second initial position, the third initial position, and the fourth initial position is determined to obtain the seventh preset position.
8. The magnetic flux detection method according to any one of claims 1 to 7, characterized in that, After controlling the three-dimensional magnetic field camera to acquire target magnetic flux data at the horizontal and vertical axis positions, the method further includes: converting the target magnetic flux data into a magnetic field thermogram; Connect the magnetic flux data that meet the preset conditions in the magnetic field thermogram to obtain the connected components; The magnetic flux data in the connected domain that is greater than the magnetic field data threshold is taken as the magnetic field peak value, and the average value of the magnetic flux data in the connected domain is taken as the position data of the target magnet.
9. The magnetic flux detection method according to claim 8, characterized by, The method further includes: Obtain at least one scan line segment passing through the target magnet on the magnetic field thermogram; Acquire the magnetic flux data located on at least one scan line segment from the target magnetic flux data; The magnetic flux data located on the at least one scan line segment are analyzed to obtain the magnetic field peak value and magnetic pole width of the at least one scan line segment.
10. A magnetic flux detection device, characterized by, The magnetic flux detection device is applied to a testing equipment, which includes a vision system, a three-dimensional magnetic field camera, a laser displacement sensor, a horizontal axis, a vertical axis, and a horizontal axis. The product to be tested is fixed on the testing equipment. The magnetic flux detection device includes: The first determining module is used to acquire a reference point of the product under test based on the vision system; determine a first position of the target magnet relative to the reference point in the product under test, a second position of the horizontal and vertical axes when the vision system measures, and a third position of the magnet center of the target magnet relative to the reference point in the vision system. The first laser positioning module is used to determine the fourth position of the horizontal and vertical axes when the laser displacement sensor is measuring, based on the first positional relationship between laser and vision, the first position, the second position, and the third position. The second laser positioning module is used to control the laser displacement sensor to move to the fourth position, and to obtain the fifth position where the vertical axis is located and the target reading value of the laser displacement sensor. The first camera positioning module is used to determine the vertical axis position of the three-dimensional magnetic field camera during measurement based on the second positional relationship between the three-dimensional magnetic field camera and the laser, the fifth position, the target reading value and the target measurement gap; The second camera positioning module is used to determine the horizontal and vertical axis positions of the three-dimensional magnetic field camera during measurement based on the third positional relationship between the three-dimensional magnetic field camera and vision, namely the first position, the second position, and the third position. The magnetic flux acquisition module is used to control the three-dimensional magnetic field camera to acquire target magnetic flux data at the horizontal and vertical axis positions.
