A machine vision-based magnetic particle flaw detection automation detection method

CN122487487APending Publication Date: 2026-07-31HARBIN NAISHI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HARBIN NAISHI INTELLIGENT TECH CO LTD
Filing Date
2026-05-07
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

[0006]为解决现有技术中存在依赖人工或半自动检测导致效率低且主观性强、缺乏适用于复杂工件的灵活检测手段、成像光路设计不合理导致信噪比与色彩还原度不足、图像处理与识别精度不高以及系统集成度低难以实现全流程自动化的缺陷,本发明提供的技术方案为:

Benefits of technology

通过引入机械臂作为运动载体并搭载成像与光源组件,使检测过程由固定工位或人工手持转变为可编程路径的空间扫描方式,该特征来源于机械臂单元与路径规划配合实现的运动控制,使相机始终保持与工件表面的稳定相对姿态,从而能够覆盖复杂曲面及大尺寸结构件,解决了现有固定视觉系统适应性差的问题,同时提高了检测一致性与重复定位精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122487487A_ABST
    Figure CN122487487A_ABST
Patent Text Reader

Abstract

An automated magnetic particle inspection method based on machine vision is proposed, belonging to the fields of non-destructive testing and machine vision technology. Addressing the problems of existing magnetic particle inspection methods, such as reliance on manual observation, low inspection efficiency, strong subjectivity in judgment, and difficulty in automation, this paper proposes an automated inspection scheme combining a motion execution unit, an imaging unit, and an image processing model. By applying a magnetic field to the workpiece and performing magnetic particle development, target spectral image data is acquired using a specific wavelength light source and filter structure. Corrected image data is obtained by adaptively adjusting channel parameters based on a reference region. After image transformation and enhancement processing, the image is input into a recognition model to extract defect and location information. The execution unit is then controlled to complete defect marking or result output, thus automating and digitizing the inspection process. This method is suitable for batch inspection and quality assessment of surface and near-surface defects in ferromagnetic workpieces.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This technology belongs to the intersection of non-destructive testing technology and machine vision technology. Specifically, it involves a device and method that uses a robotic arm equipped with a vision system, combined with a specific light source and image processing algorithm, to automatically identify cracks on the surface of a workpiece. Background Technology

[0002] Magnetic particle testing, a typical non-destructive testing technique, has been widely used in the detection of surface and near-surface defects in ferromagnetic materials such as steel structural components, welds, pressure vessels, and rail transit components. Its basic principle lies in applying a magnetic field to the workpiece, causing a leakage magnetic field at the defect location, thereby attracting magnetic powder and forming a visible magnetic trace. Currently, magnetic particle testing mainly includes two types: dry magnetic particle testing and wet magnetic particle testing. Wet fluorescent magnetic particle testing is more widely used in precision testing scenarios due to its high sensitivity and clear display effect. In typical applications, operators need to irradiate the workpiece with ultraviolet light in a dark room and observe the fluorescent traces formed by the magnetic powder at the defect location with the naked eye to determine the defect's position and shape.

[0003] With the improvement of industrial automation, some research has attempted to introduce machine vision technology into the field of magnetic particle inspection. For example, industrial cameras are used to acquire magnetic particle images, and image processing algorithms are combined to achieve defect identification. Other solutions involve setting up light sources and cameras at fixed workstations for semi-automatic inspection of regular workpieces. However, most of these solutions still rely on fixed fields of view or simple motion mechanisms, making it difficult to meet the full-coverage inspection requirements of complex curved surfaces or large-sized workpieces. Furthermore, existing vision inspection systems are mostly based on ordinary visible light imaging or direct acquisition of ultraviolet response images, lacking optical path optimization design tailored to the development characteristics of fluorescent magnetic particles, resulting in insufficient imaging contrast or severe color distortion. In addition, in terms of image processing, traditional methods rely heavily on rule-based algorithms such as threshold segmentation and edge detection, which are sensitive to noise and exhibit unstable recognition performance under complex backgrounds or weak defect conditions, making it difficult to meet high-precision inspection requirements.

[0004] Furthermore, existing systems still have shortcomings in terms of automation integration. On the one hand, the magnetization, powder spraying, imaging, and judgment processes are often independent of each other, lacking a unified control and coordination mechanism, making it difficult to form a complete automatic detection closed loop. On the other hand, existing solutions generally do not incorporate filtering and color correction mechanisms to address the unique spectral characteristics of fluorescent magnetic powder under 365nm ultraviolet light excitation, resulting in significant color casts in the acquired images and affecting the accuracy of subsequent algorithm recognition. Simultaneously, the lack of dynamic calibration methods based on standard references makes it difficult to guarantee the stability and consistency of the system under different environmental conditions.

[0005] In summary, existing technologies suffer from several drawbacks, including reliance on manual or semi-automatic inspection leading to low efficiency and high subjectivity, lack of flexible inspection methods suitable for complex workpieces, unreasonable imaging optical path design resulting in insufficient signal-to-noise ratio and color reproduction, low image processing and recognition accuracy, and low system integration making it difficult to achieve full-process automation. Summary of the Invention

[0006] To address the shortcomings of existing technologies, such as low efficiency and high subjectivity due to reliance on manual or semi-automatic inspection, lack of flexible inspection methods suitable for complex workpieces, insufficient signal-to-noise ratio and color reproduction due to unreasonable imaging optical path design, low image processing and recognition accuracy, and low system integration making it difficult to achieve full-process automation, the technical solution provided by this invention is as follows: An automated magnetic particle inspection method based on machine vision includes: The steps include: acquiring workpiece surface data after being treated with a magnetic field and magnetic powder, controlling the imaging unit to perform path scanning on the workpiece surface based on the spatial mapping relationship between the motion execution unit and the imaging unit, and outputting the original image data. The step of acquiring and processing the original image data under specific wavelength light source illumination and filtering conditions to obtain image data with target spectral response; The step of adjusting the channel parameters of the image data based on a reference region in the same field of view to output corrected image data; The steps of performing image transformation and enhancement processing on the corrected image data to output feature-enhanced image data; The step of inputting the feature-enhanced image data into the recognition model to extract the target and output the defect information and its corresponding location information; The control execution unit processes the position information to complete the step of detecting surface defects on the workpiece.

[0007] Furthermore, in a preferred embodiment, the magnetic field effect is achieved by introducing alternating current or direct current into the workpiece or by using coil magnetization to establish a spatial magnetic field distribution. The magnetic powder application process is achieved by a motion execution unit driving a spraying device to uniformly spray the workpiece surface along a preset path to form a magnetic powder developing layer.

[0008] Furthermore, in a preferred embodiment, the motion execution unit is a multi-degree-of-freedom robotic arm. The path scanning generates a motion path covering the detection area by pre-establishing a workpiece model or a preset trajectory, and controls the optical axis of the imaging unit to remain consistent with the normal of the workpiece surface and maintains the working distance within a preset range.

[0009] Furthermore, in a preferred embodiment, the specific wavelength light source is a light source with a center wavelength located at 365 nanometers, and the filtering conditions are achieved by setting a long-pass filter structure with a cutoff wavelength greater than the excitation wavelength.

[0010] Furthermore, in a preferred embodiment, the reference area is a standard grayscale area or white area set within the detection field of view, and the channel parameter adjustment is achieved by calculating the response value of the reference area in multiple channels and adaptively adjusting the channel gain.

[0011] Furthermore, in a preferred embodiment, the image transformation and enhancement processing includes grayscale processing, neighborhood weight-based smoothing processing, and contrast enhancement processing based on local statistical distribution.

[0012] Based on the same inventive concept, the present invention also provides an automated magnetic particle inspection device based on machine vision, comprising: A module that acquires workpiece surface data after being treated with a magnetic field and magnetic powder, and controls the imaging unit to perform path scanning on the workpiece surface based on the spatial mapping relationship between the motion execution unit and the imaging unit, and outputs raw image data. A module that acquires and processes the original image data under specific wavelength light source illumination and filtering conditions to obtain image data of the target spectral response; A module that adjusts the channel parameters of the image data based on a reference region in the same field of view to output corrected image data; A module that performs image transformation and enhancement processing on the corrected image data to output feature-enhanced image data; The module that inputs the feature-enhanced image data into the recognition model to extract the target and output defect information and its corresponding location information; The module that controls the execution unit to process the position information to complete the detection of surface defects on the workpiece.

[0013] Based on the same inventive concept, the present invention also provides a computer storage medium for storing a computer program, wherein when the computer program is read by a computer, the computer executes the method described thereon.

[0014] Based on the same inventive concept, the present invention also provides a computer, including a processor and a storage medium, wherein when the processor reads a computer program stored in the storage medium, the computer executes the method described thereon.

[0015] Based on the same inventive concept, the present invention also provides a computer program product, which, when executed, implements the method described.

[0016] Compared with the prior art, the advantages of the technical solution provided by the present invention are as follows: By introducing a robotic arm as a motion carrier and equipping it with imaging and light source components, the inspection process is transformed from a fixed station or manual handheld operation to a programmable path spatial scanning method. This feature stems from the motion control achieved by the robotic arm unit in conjunction with path planning, which ensures that the camera always maintains a stable relative posture with the workpiece surface. This enables the system to cover complex curved surfaces and large-sized structural parts, solving the problem of poor adaptability of existing fixed vision systems and improving inspection consistency and repeatability accuracy.

[0017] By controlling the current to energize the workpiece or magnetizing the coil during the magnetization process, a stable leakage magnetic field is formed inside the workpiece. In conjunction with the uniform spraying of water-magnetic powder suspension by the nozzle, this feature comes from the synergistic effect of the magnetization unit and the execution unit, which enables the magnetic powder to form a clear aggregation in the defect area, thereby ensuring the sufficiency of defect development. Compared with the problems of uneven spraying and unstable magnetization in manual operation, it significantly improves the consistency and reliability of defect development.

[0018] By using an LED ultraviolet light source array with a wavelength of 365nm to excite the workpiece and setting a long-pass filter in front of the camera lens to filter out the excitation light, only allowing the visible fluorescence emitted by the magnetic powder to pass through, this feature comes from the combination of a specific light source and a filter structure, which enables the imaging system to effectively suppress background reflection and stray light interference, thereby obtaining a high-contrast image. Compared with traditional visible light or unfiltered ultraviolet imaging methods, it significantly improves the signal-to-noise ratio between the magnetic trace area and the background.

[0019] By setting a standard grayscale color chart or whiteboard in the acquisition field of view and dynamically adjusting the camera's red and blue gain parameters based on the average RGB component value of that area in the image, this feature comes from the white balance correction mechanism based on the reference color chart. This enables the system to compensate for the overall color cast caused by the 365nm light source in real time, thereby restoring the true color of magnetic powder development. Compared with traditional fixed parameters or no correction method, it significantly improves the image color consistency and cross-environment stability.

[0020] By performing grayscale conversion, Gaussian denoising, and adaptive histogram equalization on the corrected image, this feature is derived from the combined application of image preprocessing algorithms. This effectively suppresses random noise in the image and enhances the local contrast of the magnetic trace region, thus providing a clearer feature expression for subsequent recognition. Compared with existing technologies that directly process the original image or only use simple filtering methods, this improves the detectability of small defects.

[0021] By constructing a detection model based on deep learning to identify preprocessed images and outputting defect category and spatial coordinate information, this feature comes from the introduction of target detection algorithm, which enables the system to automatically extract linear or dot-like magnetic powder aggregation features from complex backgrounds. Compared with traditional methods based on thresholds or edge rules, it significantly improves the accuracy and robustness of identifying small defects and complex morphological defects.

[0022] By linking the detection results with the robotic arm control system, the end effector is driven to mark or generate a detection report based on the identified defect coordinates. This feature comes from the closed-loop control of the detection algorithm output and the actuator, which enables the detection results to be directly converted into physical labels or digital records. Compared with manual recording or offline processing, this improves the automation level and data traceability of the detection process.

[0023] By integrating and controlling functions such as magnetization, powder spraying, imaging, correction, identification, and marking into a unified system, this feature stems from the co-design of hardware and software. It creates a continuous data and control link between each processing stage, thereby constructing a complete automated detection closed loop. Compared with the existing distributed equipment combination method, it significantly improves the system's operating efficiency and overall stability, while reducing the need for manual intervention.

[0024] It is suitable for automated detection and quality assessment of surface and near-surface defects in ferromagnetic workpieces in nondestructive testing. Attached Figure Description

[0025] Figure 1 Images of the imaging unit and light source module; Figure 2 This is a physical image of an automated magnetic particle inspection device based on machine vision. Detailed Implementation

[0026] To make the advantages and benefits of the technical solution provided by the present invention clearer, the technical solution provided by the present invention will now be described in further detail with reference to the accompanying drawings, specifically: Implementation Method 1: This implementation method provides an automated magnetic particle inspection method based on machine vision, including: The steps include: acquiring workpiece surface data after being treated with a magnetic field and magnetic powder, controlling the imaging unit to perform path scanning on the workpiece surface based on the spatial mapping relationship between the motion execution unit and the imaging unit, and outputting the original image data. The step of acquiring and processing the original image data under specific wavelength light source illumination and filtering conditions to obtain image data with target spectral response; The step of adjusting the channel parameters of the image data based on a reference region in the same field of view to output corrected image data; The steps of performing image transformation and enhancement processing on the corrected image data to output feature-enhanced image data; The step of inputting the feature-enhanced image data into the recognition model to extract the target and output the defect information and its corresponding location information; The control execution unit processes the position information to complete the step of detecting surface defects on the workpiece.

[0027] The magnetic field effect is achieved by introducing alternating current or direct current into the workpiece or by using coil magnetization to establish a spatial magnetic field distribution. The magnetic powder application process is achieved by a motion execution unit driving a spraying device to uniformly spray the workpiece surface along a preset path to form a magnetic powder developing layer.

[0028] The motion execution unit is a multi-degree-of-freedom robotic arm. The path scanning generates a motion path covering the detection area by using a pre-established workpiece model or preset trajectory, and controls the optical axis of the imaging unit to keep consistent with the normal of the workpiece surface and maintain the working distance within a preset range.

[0029] The specific wavelength light source is a light source with a center wavelength of 365 nanometers. The filtering conditions are achieved by setting a long-pass filter structure with a cutoff wavelength greater than the excitation wavelength.

[0030] The reference area is a standard grayscale or white area set within the detection field of view. Channel parameter adjustment is achieved by calculating the response value of the reference area in multiple channels and adaptively adjusting the channel gain.

[0031] Image transformation and enhancement processing includes grayscale processing, neighborhood weight-based smoothing processing, and contrast enhancement processing based on local statistical distribution.

[0032] Based on the same inventive concept, the present invention also provides an automated magnetic particle inspection device based on machine vision, comprising: A module that acquires workpiece surface data after being treated with a magnetic field and magnetic powder, and controls the imaging unit to perform path scanning on the workpiece surface based on the spatial mapping relationship between the motion execution unit and the imaging unit, and outputs raw image data. A module that acquires and processes the original image data under specific wavelength light source illumination and filtering conditions to obtain image data of the target spectral response; A module that adjusts the channel parameters of the image data based on a reference region in the same field of view to output corrected image data; A module that performs image transformation and enhancement processing on the corrected image data to output feature-enhanced image data; The module that inputs the feature-enhanced image data into the recognition model to extract the target and output defect information and its corresponding location information; The module that controls the execution unit to process the position information to complete the detection of surface defects on the workpiece.

[0033] A computer storage medium is also provided for storing a computer program, which, when read by the computer, executes the method.

[0034] A computer is also provided, including a processor and a storage medium, wherein the computer executes the method when the processor reads a computer program stored in the storage medium.

[0035] A computer program product is also provided, which, when executed, implements the method described.

[0036] Implementation Method Two: This implementation method is a further detailed description of the technical solution provided in Implementation Method One, specifically: First, let me briefly describe the overall process. This solution uses a robotic arm as the main motion execution body, integrating magnetization, current control, magnetic powder spraying, optical imaging, color correction, image enhancement, defect recognition, and result execution. By constructing a stable leakage magnetic field on the workpiece surface and forming magnetic powder development, high-quality image data is acquired under a controlled optical environment. After dynamic color correction and multi-level image enhancement processing, the data is input into the recognition model to obtain defect information. The recognition results are then fed back to the execution mechanism to complete marking or recording, so that each processing link forms a continuous data flow and control link. The output of the previous link serves as the input of the next link, thereby realizing a closed-loop automatic detection process from physical development to intelligent judgment and result execution.

[0037] The workpiece to be inspected is fixed on the inspection table and electrically connected to the magnetizing power supply via wires. The AC or DC magnetization method is selected according to the workpiece material and inspection requirements, so that the current forms a continuous magnetic field distribution inside the workpiece, generating a leakage magnetic field in areas with defects such as cracks or inclusions. After the magnetic field is established, the robotic arm is controlled to move the nozzle along a preset trajectory, so that the water-based magnetic powder suspension is sprayed evenly onto the surface of the workpiece at a stable flow rate. Under the combined action of gravity, fluid resistance, and the attraction of the leakage magnetic field, the magnetic powder particles migrate to the defect area and aggregate, gradually forming a magnetic trace structure with spatial continuity. The morphological information of the magnetic trace serves as the direct input for subsequent visual inspection.

[0038] After the magnetic traces are formed, the spatial relationship between the robotic arm and the vision imaging system is calibrated. By obtaining the correspondence between the end pose of the robotic arm and the camera imaging coordinates, a mapping model from the robotic arm coordinate system to the image coordinate system is established. Combined with the geometric contour of the workpiece or a preset scanning strategy, path data covering the entire detection area is generated, so that the robotic arm can keep the camera optical axis consistent with the normal direction of the workpiece surface during the movement, and at the same time control the distance between the camera and the workpiece surface to change within a predetermined range, thereby outputting a stable imaging pose sequence as the control basis for subsequent image acquisition.

[0039] After obtaining the imaging pose sequence, the robotic arm is controlled to move sequentially to each detection position. At each position, an ultraviolet light source with a wavelength of 365 nanometers is turned on to excite and illuminate the workpiece surface. At the same time, a long-pass filter structure is set in front of the camera lens to effectively block the ultraviolet reflection component with a wavelength lower than the set cutoff value in the incident light, allowing only the visible light signal emitted by the magnetic powder after excitation to enter the camera's photosensitive device. Thus, under the condition of suppressing background reflection and stray light interference, an original color image containing the magnetic powder development characteristics is acquired. This original image is used as the input for color correction processing.

[0040] After acquiring the original image, a pre-arranged standard grayscale color chart or white reference area is selected within the current field of view. The pixel values ​​of this area in the red, green, and blue channels are statistically analyzed, the average response intensity of each channel is calculated, and the gain parameters inside the camera are adjusted according to the deviation relationship between the channels to make the three-channel output tend to be balanced, thereby offsetting the overall color shift caused by ultraviolet excitation, so that the magnetic powder developed area presents a stable and realistic color expression in the image, and the color-corrected image data is obtained. This data is used as the input for subsequent image enhancement processing.

[0041] The color-corrected image is converted to grayscale to reduce data dimensionality, and a neighborhood-weighted smoothing process is applied to the grayscale image to reduce random noise. At the same time, the grayscale distribution of local areas of the image is dynamically stretched, so that the magnetic trace areas with low contrast are enhanced in the grayscale space. This allows fine cracks or weak magnetic traces to be significantly separated from the background, resulting in an enhanced image with improved contrast and controlled noise. This enhanced image serves as the input data for the defect recognition model.

[0042] The enhanced image is input into a pre-trained target detection model. Through multi-layer feature extraction and spatial semantic analysis, the model identifies linear, dot-like, or irregular magnetic powder aggregation areas in the image. The model outputs the category information of each abnormal area and its position parameters in the image. Based on the established coordinate mapping relationship, the image position parameters are converted into spatial positions in the robotic arm coordinate system, thereby obtaining the defect position information corresponding to the actual workpiece. This position information serves as the input for the result execution stage.

[0043] Based on the identified spatial location of the defect, the end effector of the robotic arm is controlled to move to the corresponding position. The defect is marked on the workpiece surface using a marking pen, inkjet printer, or other methods. At the same time, the detection results and location information are recorded and electronic detection data is generated. After completing the processing of the current field of view, the robotic arm is driven to move to the next detection area according to the preset path. The image acquisition, correction, enhancement, and recognition process is repeated until the entire workpiece surface is fully covered, thereby realizing continuous automated magnetic particle inspection.

[0044] Implementation Method 3, in conjunction with Appendix Figure 1-2 This embodiment describes the technical solution provided above in further detail through specific examples. Specifically: This implementation proposes an automated detection scheme that combines hardware and software.

[0045] The hardware system includes: Robotic arm unit: As a mobile carrier, it is equipped with vision and light source systems to achieve flexible scanning of complex workpiece surfaces.

[0046] Color imaging unit: Employs an industrial color camera, along with a specific light source filter, to capture magnetic particle images.

[0047] Excitation lighting module: Uses an LED ultraviolet light source array with a wavelength of 365nm.

[0048] Execution unit: includes a nozzle device for automatically spraying water magnetic powder suspension.

[0049] Magnetizing unit: The workpiece is energized by current or magnetized by coil to generate a leakage magnetic field.

[0050] The software processing flow includes the following steps: Step 1: Magnetizing and spraying the workpiece The magnetizing power supply is controlled to supply AC or DC current to the workpiece to establish a magnetic field; at the same time, the robotic arm is controlled to drive the nozzle to evenly spray a suspension of water-magnetic powder, and then left to stand for magnetic marks to form.

[0051] Step 2: Vision system calibration and path planning Perform hand-eye calibration, plan the robotic arm scanning path, and ensure that the camera optical axis is perpendicular to the workpiece surface and the object distance is constant.

[0052] Step 3: Image acquisition under specific optical paths (key improvement point) The robotic arm moves to the detection position and illuminates the workpiece with a 365nm light source. A long-pass filter (preferably with a cutoff wavelength of 400nm) is installed in front of the camera lens to filter out the 365nm reflected light, allowing only the visible light excited by the magnetic powder to pass through. The original image is then acquired.

[0053] Step 4: White balance correction based on reference color chart (key improvement point) Place a standard grayscale color chart or whiteboard next to the workpiece. Based on the acquired image, calculate the mean RGB component values ​​of the color chart area, and dynamically adjust the red and blue gain parameters of the camera using the grayscale world algorithm or the perfect reflection hypothesis algorithm to generate a flaw detection image with accurate color reproduction and eliminate the purple / blue tint caused by the 365nm light source.

[0054] Step 5: Image Preprocessing The corrected image is converted to grayscale, Gaussian denoising is performed, and adaptive histogram equalization is used to enhance the contrast between the magnetic traces and the background.

[0055] Step 6: Crack Target Detection Algorithm A deep learning-based detection model is constructed. The pre-processed image is input into the model, which uses a trained weight file to identify linear or dot-like abnormal regions formed by the aggregation of water magnetic powder in the image, and outputs the category and coordinates of the defects.

[0056] Step 7: Result Determination and Output Based on the coordinates output by the algorithm, the marking pen or inkjet printer at the end of the robotic arm is controlled to perform physical marking or generate an electronic inspection report.

[0057] This implementation method achieves significant technological advancements through the following technical means: Fully automated inspection: By using robotic arms to replace manual hand-held cameras, unmanned operation is achieved, eliminating the harm of ultraviolet rays to personnel.

[0058] High signal-to-noise ratio imaging: By combining a 365nm light source with a specific filter and adjusting the white balance of a color camera, the development characteristics of water magnetic powder can be clearly captured.

[0059] Objective judgment: The introduction of target detection algorithms replaces subjective human visual observation, improving the accuracy and consistency of defect judgment.

[0060] High flexibility: The introduction of robotic arms enables the system to adapt to the inspection needs of workpieces with various complex shapes.

[0061] In one embodiment: 1. Hardware Configuration Robotic arm: Six-axis collaborative robot with repeatability accuracy of ±0.05mm.

[0062] Vision system: High-resolution industrial color area array camera.

[0063] Light source system: LED ultraviolet light source array with a wavelength of 365nm.

[0064] Auxiliary device: magnetic powder spray pump and nozzle, the magnetic powder is water-based fluorescent magnetic powder.

[0065] 2. Implementation Steps Step A: Place the workpiece to be inspected on the inspection table and pass current through a wire to perform circumferential magnetization.

[0066] Step B: The robotic arm moves to the starting position, turns on the nozzle, and evenly sprays the water magnetic powder suspension.

[0067] Step C: The robotic arm, equipped with a vision module, moves to the detection position, turns on the 365nm light source, and installs a filter in front of the camera lens.

[0068] Step D: Perform white balance calibration on the camera and acquire the current field of view image.

[0069] Step E: The image is transmitted to the industrial control computer, and the target detection algorithm is run. The algorithm model is trained on a large number of magnetic powder defect images and can identify tiny magnetic powder aggregation areas.

[0070] Step F: If a defect is detected, the robotic arm pauses and records the coordinates; if no defect is detected, it moves to the next field of view until the entire workpiece has been scanned.

[0071] The above description of several specific embodiments further details the technical solution provided by the present invention in order to highlight the advantages and benefits of the technical solution provided by the present invention. However, the above-described specific embodiments are not intended to limit the present invention. Any reasonable modifications and improvements to the present invention, combinations of embodiments, and equivalent substitutions based on the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. An automated magnetic particle inspection method based on machine vision, characterized in that, include: The steps include: acquiring workpiece surface data after being treated with a magnetic field and magnetic powder, controlling the imaging unit to perform path scanning on the workpiece surface based on the spatial mapping relationship between the motion execution unit and the imaging unit, and outputting the original image data. The step of acquiring and processing the original image data under specific wavelength light source illumination and filtering conditions to obtain image data with target spectral response; The step of adjusting the channel parameters of the image data based on a reference region in the same field of view to output corrected image data; The steps of performing image transformation and enhancement processing on the corrected image data to output feature-enhanced image data; The step of inputting the feature-enhanced image data into the recognition model to extract the target and output the defect information and its corresponding location information; The control execution unit processes the position information to complete the step of detecting surface defects on the workpiece.

2. The automated magnetic particle inspection method based on machine vision according to claim 1, characterized in that, The magnetic field effect is achieved by introducing alternating current or direct current into the workpiece or by using coil magnetization to establish a spatial magnetic field distribution. The magnetic powder application process is achieved by a motion execution unit driving a spraying device to uniformly spray the workpiece surface along a preset path to form a magnetic powder developing layer.

3. The automated magnetic particle inspection method based on machine vision according to claim 1, characterized in that, The motion execution unit is a multi-degree-of-freedom robotic arm. The path scanning generates a motion path covering the detection area by using a pre-established workpiece model or preset trajectory, and controls the optical axis of the imaging unit to keep consistent with the normal of the workpiece surface and maintain the working distance within a preset range.

4. The automated magnetic particle inspection method based on machine vision according to claim 1, characterized in that, The specific wavelength light source is a light source with a center wavelength of 365 nanometers. The filtering conditions are achieved by setting a long-pass filter structure with a cutoff wavelength greater than the excitation wavelength.

5. The automated magnetic particle inspection method based on machine vision according to claim 1, characterized in that, The reference area is a standard grayscale or white area set within the detection field of view. Channel parameter adjustment is achieved by calculating the response value of the reference area in multiple channels and adaptively adjusting the channel gain.

6. The automated magnetic particle inspection method based on machine vision according to claim 1, characterized in that, Image transformation and enhancement processing includes grayscale processing, neighborhood weight-based smoothing processing, and contrast enhancement processing based on local statistical distribution.

7. An automated magnetic particle inspection device based on machine vision, characterized in that, include: A module that acquires workpiece surface data after being treated with a magnetic field and magnetic powder, and controls the imaging unit to perform path scanning on the workpiece surface based on the spatial mapping relationship between the motion execution unit and the imaging unit, and outputs raw image data. A module that acquires and processes the original image data under specific wavelength light source illumination and filtering conditions to obtain image data of the target spectral response; A module that adjusts the channel parameters of the image data based on a reference region in the same field of view to output corrected image data; A module that performs image transformation and enhancement processing on the corrected image data to output feature-enhanced image data; The module that inputs the feature-enhanced image data into the recognition model to extract the target and output defect information and its corresponding location information; The module that controls the execution unit to process the position information to complete the detection of surface defects on the workpiece.

8. A computer storage medium for storing computer programs, characterized in that, When the computer program is read by the computer, the computer executes the method of claim 1.

9. A computer, comprising a processor and a storage medium, characterized in that, When the processor reads the computer program stored in the storage medium, the computer executes the method of claim 1.

10. A computer program product, as a computer program, is characterized by: When the computer program is executed, it implements the method of claim 1.